ysy před 1 rokem
rodič
revize
adb148a5fd

+ 29 - 17
src/views/productionPlan/index.vue

@@ -29,18 +29,27 @@
         </template>
 
         <template v-slot:priority="{ row }">
-       <el-input
-         v-model="row.priority"
-         type="number"
-         size="mini"
-         @change="priorityChange(row)"
-       ></el-input>
-       <div class="sort-wrap">
-         <i class="el-icon-caret-top" @click="sortTop(row)"></i>
-         <i class="el-icon-caret-bottom" @click="sortBottom(row)"></i>
-       </div>
+          <el-input
+            v-model="row.priority"
+            type="number"
+            size="mini"
+            :min="0"
+            :max="10"
+            @change="priorityChange(row)"
+          ></el-input>
 
-     </template>
+          <el-popover
+            placement="right"
+            width="200"
+            trigger="hover"
+            content="数值越大优先级越高(0-3普通, 4-6优先, 7-10紧急)"
+          >
+            <div class="sort-wrap"  slot="reference">
+              <i class="el-icon-caret-top" @click="sortTop(row)"></i>
+              <i class="el-icon-caret-bottom" @click="sortBottom(row)"></i>
+            </div>
+          </el-popover>
+        </template>
 
         <template v-slot:productWeight="{ row }">
           {{ row.productWeight }} {{ row.weightUnit }}
@@ -454,17 +463,20 @@
       },
 
       priorityChange(row) {
+        if (row.priority > 10) {
+          row.priority = 10; // 如果大于 10,则设置为 10
+        } else if (row.priority < 0) {
+          row.priority = 0; // 如果小于 0,则设置为 0
+        }
+
         this.priorityFn(row);
       },
-
       priorityFn: debounce(function (row) {
-        let params = { 
+        let params = {
           id: row.id,
           priority: row.priority
-        }
-        updatePriority(params).then((res) => {
-         
-        })
+        };
+        updatePriority(params).then((res) => {});
       }, 800)
     }
   };

+ 19 - 6
src/views/saleOrder/index.vue

@@ -34,13 +34,21 @@
             v-model="row.priority"
             type="number"
             size="mini"
+              :min="0"
+         :max="10"
             @change="priorityChange(row)"
           ></el-input>
-          <div class="sort-wrap">
-            <i class="el-icon-caret-top" @click="sortTop(row)"></i>
-            <i class="el-icon-caret-bottom" @click="sortBottom(row)"></i>
-          </div>
-   
+          <el-popover
+            placement="right"
+            width="200"
+            trigger="hover"
+            content="数值越大优先级越高(0-3普通, 4-6优先, 7-10紧急)"
+          >
+            <div class="sort-wrap"  slot="reference">
+              <i class="el-icon-caret-top" @click="sortTop(row)"></i>
+              <i class="el-icon-caret-bottom" @click="sortBottom(row)"></i>
+            </div>
+          </el-popover>
         </template>
 
         <template v-slot:productSumWeight="{ row }">
@@ -358,9 +366,14 @@
       },
 
       priorityChange(row) {
+        if (row.priority > 10) {
+          row.priority = 10; // 如果大于 10,则设置为 10
+        } else if (row.priority < 0) {
+          row.priority = 0; // 如果小于 0,则设置为 0
+        }
+
         this.priorityFn(row);
       },
-
       priorityFn: debounce(function (row) {
         let params = { 
           id: row.id,

+ 20 - 4
src/views/saleOrder/salesToProduction.vue

@@ -275,12 +275,21 @@
               v-model="row.priority"
               type="number"
               size="mini"
+                :min="0"
+          :max="10"
               @change="priorityChange(row)"
             ></el-input>
-            <div class="sort-wrap">
+            <el-popover
+            placement="right"
+            width="200"
+            trigger="hover"
+            content="数值越大优先级越高(0-3普通, 4-6优先, 7-10紧急)"
+          >
+            <div class="sort-wrap"  slot="reference">
               <i class="el-icon-caret-top" @click="sortTop(row)"></i>
               <i class="el-icon-caret-bottom" @click="sortBottom(row)"></i>
             </div>
+          </el-popover>
             </template>
           </el-table-column>
 
@@ -527,11 +536,18 @@
       },
 
       priorityChange(row) {
-        console.log(row);
-        this.priorityFn();
+        if (row.priority > 10) {
+          row.priority = 10; // 如果大于 10,则设置为 10
+        } else if (row.priority < 0) {
+          row.priority = 0; // 如果小于 0,则设置为 0
+        }
+
+        this.priorityFn(row);
       },
 
-      priorityFn: debounce(function () {}, 1000),
+      priorityFn: debounce(function (row) {
+    
+      }, 800),
 
       // 删除产品
       handleDeleteItem(index) {

+ 55 - 47
src/views/workOrder/index.vue

@@ -17,28 +17,31 @@
           {{ row.code }}
         </template>
 
-
         <template v-slot:formingWeight="{ row }">
           {{ row.formingWeight }} {{ row.newWeightUnit }}
         </template>
 
         <template v-slot:priority="{ row }">
-       <el-input
-         v-model="row.priority"
-         type="number"
-         size="mini"
-         @change="priorityChange(row)"
-       ></el-input>
-       <div class="sort-wrap">
-         <i class="el-icon-caret-top" @click="sortTop(row)"></i>
-         <i class="el-icon-caret-bottom" @click="sortBottom(row)"></i>
-       </div>
-
-     </template>
-
-
-
-        
+          <el-input
+            v-model="row.priority"
+            type="number"
+            size="mini"
+            :min="0"
+            :max="10"
+            @change="priorityChange(row)"
+          ></el-input>
+          <el-popover
+            placement="right"
+            width="200"
+            trigger="hover"
+            content="数值越大优先级越高(0-3普通, 4-6优先, 7-10紧急)"
+          >
+            <div class="sort-wrap" slot="reference">
+              <i class="el-icon-caret-top" @click="sortTop(row)"></i>
+              <i class="el-icon-caret-bottom" @click="sortBottom(row)"></i>
+            </div>
+          </el-popover>
+        </template>
 
         <template v-slot:status="{ row }">
           <span :class="{ 'ele-text-danger': row.status == 3 }">
@@ -79,7 +82,11 @@
 </template>
 
 <script>
-  import { getList, releaseWorkOrder, updatePriority } from '@/api/workOrder/index.js';
+  import {
+    getList,
+    releaseWorkOrder,
+    updatePriority
+  } from '@/api/workOrder/index.js';
   import { teamPage } from '@/api/mainData/index.js';
   import OrderSearch from './components/order-search.vue';
   import { debounce } from 'lodash';
@@ -87,7 +94,7 @@
     components: {
       OrderSearch
     },
-    data () {
+    data() {
       return {
         visible: false,
         loading: false,
@@ -103,14 +110,12 @@
           { label: '待下达', value: 8 }
         ],
 
-        current: null,
-
-        
+        current: null
       };
     },
     computed: {
       // 表格列配置
-      columns () {
+      columns() {
         return [
           {
             columnKey: 'index',
@@ -174,14 +179,12 @@
             sortable: true
           },
 
-
           {
             prop: 'formingNum',
             label: '要求生产数量',
             align: 'center',
             showOverflowTooltip: true,
-            minWidth: 110,
-          
+            minWidth: 110
           },
           {
             prop: 'formingWeight',
@@ -224,7 +227,6 @@
             }
           },
 
-          
           {
             prop: 'serialNo',
             label: '客户代号',
@@ -252,16 +254,14 @@
         ];
       }
     },
-    created () {
-    
-    },
+    created() {},
     methods: {
-      statusFormatter (status) {
+      statusFormatter(status) {
         const obj = this.statusOpt.find((i) => i.value == status);
         return obj && obj.label;
       },
       /* 表格数据源 */
-      datasource ({ page, limit, where }) {
+      datasource({ page, limit, where }) {
         if (where.status) {
           where.statusList = [];
           where.statusList.push(where.status);
@@ -272,27 +272,32 @@
           ...where
         });
       },
-      async _teamPage () {
-        const res = await teamPage({ page: 1, size: -1, produceVersionId: this.current.produceVersionId });
+      async _teamPage() {
+        const res = await teamPage({
+          page: 1,
+          size: -1,
+          produceVersionId: this.current.produceVersionId
+        });
 
         this.teamList = res.list;
       },
       // 下达
-      toRelease (row) {
-        this.current = row
+      toRelease(row) {
+        this.current = row;
         this.visible = true;
         this._teamPage();
-      
       },
       // 下达
-      confirm () {
+      confirm() {
         if (!this.releasParams.teamId) {
           return this.$message.error('请选择班组');
         }
-   
 
         const loading = this.$loading({ text: '加载中...' });
-        releaseWorkOrder({id: this.current.id, teamId: this.releasParams.teamId})
+        releaseWorkOrder({
+          id: this.current.id,
+          teamId: this.releasParams.teamId
+        })
           .then((res) => {
             if (res) {
               this.$message.success('成功');
@@ -305,13 +310,12 @@
           });
       },
       /* 刷新表格 */
-      reload (where) {
+      reload(where) {
         this.$nextTick(() => {
           this.$refs.table.reload({ page: 1, where });
         });
       },
 
-      
       sortTop(row) {
         row.priority = Number(row.priority) + 1;
         this.priorityChange(row);
@@ -325,17 +329,21 @@
       },
 
       priorityChange(row) {
+        if (row.priority > 10) {
+          row.priority = 10; // 如果大于 10,则设置为 10
+        } else if (row.priority < 0) {
+          row.priority = 0; // 如果小于 0,则设置为 0
+        }
+
         this.priorityFn(row);
       },
 
       priorityFn: debounce(function (row) {
-        let params = { 
+        let params = {
           id: row.id,
           priority: row.priority
-        }
-        updatePriority(params).then((res) => {
-         
-        })
+        };
+        updatePriority(params).then((res) => {});
       }, 800)
     }
   };