695593266@qq.com hace 8 meses
padre
commit
67247cf076

+ 3 - 1
src/views/cuttingPlan/index.vue

@@ -17,8 +17,10 @@
         :datasource="datasource"
         @columns-change="handleColumnChange"
         :cacheKey="cacheKeyUrl"
-        :pageSize="20"
         :pageSizes="[20, 30, 40, 50, 100]"
+           height="calc(100vh - 350px)"
+        full-height="calc(100vh - 116px)"
+        :page-size="20"
       >
         <template v-slot:toolbar>
           <el-dropdown trigger="click" @command="handleClick">

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 695 - 714
src/views/materialPlan/components/plan-edit-dialog.vue


+ 224 - 144
src/views/materialPlan/components/timeDialog.vue

@@ -1,166 +1,246 @@
 <template>
-    <el-dialog :title="title" :visible.sync="visible" :before-close="handleClose" :close-on-click-modal="false"
-        :close-on-press-escape="false" append-to-body width="35%">
-
-        <el-form :model="form" ref="tableForm" class="tableForm" :rules="tableFormRules">
-            <el-button type="primary" size="small" style="margin-bottom: 10px" @click="handleAdd()">新增</el-button>
-            <el-table ref="multipleTable" :data="form.timeList" tooltip-effect="dark" style="width: 100%" stripe
-                :header-cell-style="{ background: '#EEEEEE', border: 'none' }">
-
-
-
-                <el-table-column label="数量" prop="purchaseQuantity">
-                    <template slot-scope="{ row, $index }">
-                        <el-form-item :prop="'timeList.' + $index + '.purchaseQuantity'"
-                            :rules="tableFormRules.purchaseQuantity">
-
-                            <el-input placeholder="请输入" clearable v-model="row.purchaseQuantity"></el-input>
-                        </el-form-item>
-
-                    </template>
-                </el-table-column>
-
-
-
-                <el-table-column label="到货时间">
-                    <template slot-scope="{ row, $index }">
-                        <el-form-item :prop="'timeList.' + $index + '.requireDeliveryTime'"
-                            :rules="tableFormRules.requireDeliveryTime">
-                            <el-date-picker clearable v-model="row.requireDeliveryTime" value-format="timestamp"
-                                placeholder="请选择日期" :pickerOptions="{
-                                    disabledDate: (time) =>
-                                        time.getTime() <
-                                        new Date(new Date().setHours(0, 0, 0, 0)).getTime()
-                                }">
-                            </el-date-picker>
-                        </el-form-item>
-                    </template></el-table-column>
-
-                <el-table-column label="操作" prop="action" width="80">
-                    <template slot-scope="{ $index }">
-                        <el-link type="primary" :underline="false" @click="handleDel($index)">删除</el-link>
-                    </template>
-                </el-table-column>
-
-
-            </el-table>
-
-        </el-form>
-
-
-
-
-        <div class="btns">
-            <el-button type="primary" size="small" @click="handleOk">确认</el-button>
-            <el-button size="small" @click="handleClose">取消</el-button>
-        </div>
-    </el-dialog>
+  <el-dialog
+    :title="title"
+    :visible.sync="visible"
+    :before-close="handleClose"
+    :close-on-click-modal="false"
+    :close-on-press-escape="false"
+    append-to-body
+    width="35%"
+  >
+    <el-form
+      :model="form"
+      ref="tableForm"
+      class="tableForm"
+      :rules="tableFormRules"
+    >
+      <el-button
+        type="primary"
+        size="small"
+        style="margin-bottom: 10px"
+        @click="handleAdd()"
+        >新增</el-button
+      >
+      <span style="margin-left: 10px" v-if="!isAll"
+        >待分配数量:<span style="color: #1890ff">{{ num }}</span></span
+      >
+      <el-table
+        ref="multipleTable"
+        :data="form.timeList"
+        tooltip-effect="dark"
+        style="width: 100%"
+        stripe
+        :header-cell-style="{ background: '#EEEEEE', border: 'none' }"
+      >
+        <el-table-column label="批次号" prop="batchNo">
+          <template slot-scope="{ row, $index }">
+            <el-form-item
+              :prop="'timeList.' + $index + '.batchNo'"
+              :rules="tableFormRules.batchNo"
+            >
+              <el-input
+                placeholder="请输入"
+                clearable
+                v-model="row.batchNo"
+              ></el-input>
+            </el-form-item>
+          </template>
+        </el-table-column>
+
+        <el-table-column label="数量" prop="purchaseQuantity">
+          <template slot-scope="{ row, $index }">
+            <el-form-item
+              :prop="'timeList.' + $index + '.purchaseQuantity'"
+              :rules="tableFormRules.purchaseQuantity"
+            >
+              <el-input
+                placeholder="请输入"
+                clearable
+                type="number"
+                v-model="row.purchaseQuantity"
+              ></el-input>
+            </el-form-item>
+          </template>
+        </el-table-column>
+
+        <el-table-column label="到货时间">
+          <template slot-scope="{ row, $index }">
+            <el-form-item
+              :prop="'timeList.' + $index + '.requireDeliveryTime'"
+              :rules="tableFormRules.requireDeliveryTime"
+            >
+              <el-date-picker
+                clearable
+                v-model="row.requireDeliveryTime"
+                value-format="timestamp"
+                placeholder="请选择日期"
+                :pickerOptions="{
+                  disabledDate: (time) =>
+                    time.getTime() <
+                    new Date(new Date().setHours(0, 0, 0, 0)).getTime()
+                }"
+              >
+              </el-date-picker>
+            </el-form-item> </template
+        ></el-table-column>
+
+        <el-table-column label="操作" prop="action" width="80">
+          <template slot-scope="{ $index }">
+            <el-link
+              type="primary"
+              :underline="false"
+              @click="handleDel($index)"
+              >删除</el-link
+            >
+          </template>
+        </el-table-column>
+      </el-table>
+    </el-form>
+
+    <div class="btns">
+      <el-button type="primary" size="small" @click="handleOk">确认</el-button>
+      <el-button size="small" @click="handleClose">取消</el-button>
+    </div>
+  </el-dialog>
 </template>
 
 <script>
+  import { getCode } from '@/api/codeManagement';
 
+  export default {
+    components: {},
 
-
-
-export default {
-    components: {
-    },
     data() {
-        return {
-            visible: false,
-            title: '设置分批时间',
-
-            current: null,
-            form: {
-                timeList: [
-                    {
-                        requireDeliveryTime: null,
-                        purchaseQuantity: null
-                    }
-                ]
-            },
-
-            tableFormRules: {
-                purchaseQuantity: {
-                    required: true,
-                    message: '请输入数量',
-                    trigger: 'blur'
-                },
-
-                requireDeliveryTime: {
-                    required: true,
-                    message: '请选择日期',
-                    trigger: 'change'
-                }
-            },
-            currentIndex: ''
-
+      return {
+        visible: false,
+        title: '设置分批时间',
+        isAll: false,
+        current: null,
+        form: {
+          timeList: [
+            {
+              requireDeliveryTime: null,
+              purchaseQuantity: null,
+              batchNo: null
+            }
+          ]
+        },
 
-        }
+        tableFormRules: {
+          purchaseQuantity: {
+            required: true,
+            message: '请输入数量',
+            trigger: 'blur'
+          },
+          batchNo: {
+            required: true,
+            message: '请输入批次号',
+            trigger: 'blur'
+          },
+          requireDeliveryTime: {
+            required: true,
+            message: '请选择日期',
+            trigger: 'change'
+          }
+        },
+        currentIndex: '',
+        count: 0
+      };
     },
 
-    watch: {
-
+    watch: {},
+    computed: {
+      num() {
+        console.log(this.form.timeList, 'this.form.timeList');
+        return (
+          this.count -
+            this.form.timeList.reduce((pre, cur) => {
+              return pre + (Number(cur.purchaseQuantity) || 0);
+            }, 0) || 0
+        );
+      }
     },
     methods: {
-
-        open(row, index) {
-            console.log(row, 'row', index)
-            if (row) {
-                let row1 = JSON.parse(JSON.stringify(row))
-                this.form.timeList = row1.timeList || []
-                this.current = row1;
-                this.currentIndex = index;
+      open(row, index, isAll) {
+        this.isAll = isAll;
+        console.log(row, 'row', index);
+        if (row) {
+          let row1 = JSON.parse(JSON.stringify(row));
+          this.count = row1.demandQuantity || 0;
+          this.form.timeList = row1.timeList || [];
+          this.form.timeList?.forEach(async (item, index) => {
+            if (!item.batchNo) {
+              this.$set(
+                this.form.timeList[index],
+                'batchNo',
+                await getCode('lot_number_code')
+              );
+            }
+          });
+          this.current = row1;
+          this.currentIndex = index;
+        }
+        this.visible = true;
+      },
+
+      async handleAdd() {
+        this.form.timeList.push({
+          requireDeliveryTime: null,
+          purchaseQuantity: null,
+          batchNo: await getCode('lot_number_code')
+        });
+      },
+
+      handleDel(index) {
+        this.form.timeList.splice(index, 1);
+      },
+
+      handleOk() {
+        this.$refs.tableForm.validate((valid) => {
+          if (valid) {
+            const clonedTimeList = JSON.parse(
+              JSON.stringify(this.form.timeList)
+            );
+            if (!this.isAll) {
+              if (this.num < 0) {
+                return this.$message.warning('分配数量不能大于需求数量!');
+              }
+              if (this.num > 0) {
+                return this.$message.warning('需求数量还未分配完,请检查!');
+              }
             }
-            this.visible = true
-        },
-
-
-        handleAdd() {
-            this.form.timeList.push({
-                requireDeliveryTime: null,
-                purchaseQuantity: null
-            })
-        },
-
-        handleDel(index) {
-            this.form.timeList.splice(index, 1)
-        },
-
-
-        handleOk() {
-            this.$refs.tableForm.validate((valid) => {
-                if (valid) {
-                    const clonedTimeList = JSON.parse(JSON.stringify(this.form.timeList));
-                    this.$emit('chooseTime', this.current, clonedTimeList, this.currentIndex);
-                    this.handleClose();
-                }
-            });
-        },
-
-
-
-
-        handleClose() {
-            this.visible = false
-            this.form.timeList = [{
-                requireDeliveryTime: null,
-                purchaseQuantity: null
-            }];
-        },
-
 
+            this.$emit(
+              'chooseTime',
+              this.current,
+              clonedTimeList,
+              this.currentIndex
+            );
+            this.handleClose();
+          }
+        });
+      },
+
+      handleClose() {
+        this.visible = false;
+        this.form.timeList = [
+          {
+            requireDeliveryTime: null,
+            purchaseQuantity: null
+          }
+        ];
+      }
     }
-}
+  };
 </script>
 
 <style lang="scss" scoped>
-.btns {
+  .btns {
     margin-top: 20px;
     text-align: center;
-}
+  }
 
-.el-form-item {
+  .el-form-item {
     margin-bottom: 20px !important;
-}
-</style>
+  }
+</style>

+ 3 - 0
src/views/materialPlan/index.vue

@@ -20,6 +20,9 @@
         :pageSizes="[20, 30, 40, 50, 100]"
         @columns-change="handleColumnChange"
         :cacheKey="cacheKeyUrl"
+        height="calc(100vh - 350px)"
+        full-height="calc(100vh - 116px)"
+        :page-size="20"
       >
         <template v-slot:toolbar>
           <el-dropdown trigger="click" @command="handleClick">

+ 3 - 0
src/views/materialPlan/pickPlan.vue

@@ -17,6 +17,9 @@
         :datasource="datasource"
         @columns-change="handleColumnChange"
         :cacheKey="cacheKeyUrl"
+           height="calc(100vh - 350px)"
+        full-height="calc(100vh - 116px)"
+        :page-size="20"
       >
         <template v-slot:toolbar>
           <el-button type="primary" @click="handleEdit('add')"

+ 3 - 0
src/views/materialPlan/usePlan.vue

@@ -17,6 +17,9 @@
         :datasource="datasource"
         @columns-change="handleColumnChange"
         :cacheKey="cacheKeyUrl"
+           height="calc(100vh - 350px)"
+        full-height="calc(100vh - 116px)"
+        :page-size="20"
       >
         <template v-slot:toolbar>
           <el-button type="primary" @click="handleEdit('add')">新增</el-button>

+ 17 - 7
src/views/productionPlan/components/homogeneityInspectDialog.vue

@@ -80,7 +80,7 @@
                 <el-input readonly v-model="planInfo.productNum"></el-input>
               </el-form-item>
             </el-col>
-            <el-col :span="6">
+            <el-col :span="6" v-if="produceType == 2">
               <el-form-item label="未发总数:">
                 <el-input
                   readonly
@@ -88,8 +88,7 @@
                 ></el-input>
               </el-form-item>
             </el-col>
-          </el-row>
-          <el-row>
+
             <el-col :span="6">
               <el-form-item label="库存数量:">
                 <el-input
@@ -98,7 +97,7 @@
                 ></el-input>
               </el-form-item>
             </el-col>
-            <el-col :span="6">
+            <el-col :span="6" v-if="produceType == 2">
               <el-form-item label="在制总数:">
                 <el-input
                   readonly
@@ -106,7 +105,7 @@
                 ></el-input>
               </el-form-item>
             </el-col>
-            <el-col :span="6">
+            <el-col :span="6" v-if="produceType == 2">
               <el-form-item label="最终缺料数量:">
                 <el-input
                   readonly
@@ -117,6 +116,11 @@
             <el-col :span="6">
               <el-form-item label="最终状态:">
                 <el-input
+                  :class="
+                    kitComInfo.finalFilledShortState == '缺料'
+                      ? 'statusRed'
+                      : 'statusGreen'
+                  "
                   readonly
                   v-model="kitComInfo.finalFilledShortState"
                 ></el-input>
@@ -166,7 +170,7 @@
                         >下发采购计划</el-button
                       >
                       <el-button
-                        v-if="produceType == 1&&formInline.bomType!=1"
+                        v-if="produceType == 1 && formInline.bomType != 1"
                         type="primary"
                         @click="issuePlan"
                         size="medium"
@@ -914,7 +918,7 @@
       },
       // 结果数据处理
       resultProcess(result) {
-        this.datasourceList=[]
+        this.datasourceList = [];
         if (!result || result.length == 0) {
           this.baseCount = '';
           this.baseUnit = '';
@@ -1210,10 +1214,16 @@
   }
   .statusRed {
     color: red;
+    :deep(.el-input__inner) {
+      color: red;
+    }
   }
 
   .statusGreen {
     color: green;
+    :deep(.el-input__inner) {
+      color: green;
+    }
   }
   .planInfo {
   }

+ 8 - 2
src/views/productionPlan/index.vue

@@ -146,6 +146,9 @@
         :parse-data="parseData"
         @update:selection="handleSelectionChange"
         @columns-change="handleColumnChange"
+        height="calc(100vh - 390px)"
+        full-height="calc(100vh - 116px)"
+        :page-size="20"
       >
         <template v-slot:batchNo="{ row }">
           <el-link type="primary" :underline="false">
@@ -213,7 +216,9 @@
         </template>
 
         <template v-slot:productNum="{ row }">
-          {{ row.productNum }} {{ row.unit }}
+          <span v-if="row.productNum">
+            {{ row.productNum }} {{ row.measuringUnit }}
+          </span>
         </template>
 
         <template v-slot:productWeight="{ row }">
@@ -221,7 +226,7 @@
         </template>
 
         <template v-slot:requiredFormingNum="{ row }">
-          {{ row.requiredFormingNum }} {{ row.unit }}
+          {{ row.requiredFormingNum }} {{ row.measuringUnit }}
         </template>
 
         <template v-slot:newSumOrderWeight="{ row }">
@@ -1221,6 +1226,7 @@
 
       //  计划分解
       disassemblePlan() {
+        console.log(this.selection, 'this.selection');
         if (this.selection.length != 1) {
           return this.$message.warning('计划分解只能选择一个计划!');
         }

+ 18 - 8
src/views/saleOrder/components/orderHomogeneityInspectDialog.vue

@@ -64,7 +64,7 @@
               </el-form-item>
             </el-col>
           </el-row>
-          <el-row :gutter="20" type="flex" style="flex-wrap: wrap">
+          <el-row :gutter="20">
             <el-col :span="6">
               <el-form-item label="编码:">
                 <el-input readonly v-model="orderInfo.productCode"></el-input>
@@ -80,7 +80,7 @@
                 <el-input readonly v-model="orderInfo.contractNum"></el-input>
               </el-form-item>
             </el-col>
-            <el-col :span="6">
+            <el-col :span="6" v-if="produceType == 1">
               <el-form-item label="未发总数:">
                 <el-input
                   readonly
@@ -88,8 +88,7 @@
                 ></el-input>
               </el-form-item>
             </el-col>
-          </el-row>
-          <el-row :gutter="20" type="flex" style="flex-wrap: wrap">
+
             <el-col :span="6">
               <el-form-item label="库存数量:">
                 <el-input
@@ -98,7 +97,7 @@
                 ></el-input>
               </el-form-item>
             </el-col>
-            <el-col :span="6">
+            <el-col :span="6" v-if="produceType == 1">
               <el-form-item label="在制总数:">
                 <el-input
                   readonly
@@ -106,7 +105,7 @@
                 ></el-input>
               </el-form-item>
             </el-col>
-            <el-col :span="6">
+            <el-col :span="6" v-if="produceType == 1">
               <el-form-item label="最终缺料数量:">
                 <el-input
                   readonly
@@ -117,6 +116,11 @@
             <el-col :span="6">
               <el-form-item label="最终状态:">
                 <el-input
+                  :class="
+                    kitComInfo.finalFilledShortState == '缺料'
+                      ? 'statusRed'
+                      : 'statusGreen'
+                  "
                   readonly
                   v-model="kitComInfo.finalFilledShortState"
                 ></el-input>
@@ -969,11 +973,11 @@
       },
       // 结果数据处理
       resultProcess(result) {
-        this.datasourceList=[]
+        this.datasourceList = [];
         if (!result || result.length == 0) {
           this.baseCount = '';
           this.baseUnit = '';
-          this.datasourceAllList = []
+          this.datasourceAllList = [];
           return;
         }
         let first = result[0];
@@ -1123,10 +1127,16 @@
 
   .statusRed {
     color: red;
+    :deep(.el-input__inner) {
+      color: red;
+    }
   }
 
   .statusGreen {
     color: green;
+    :deep(.el-input__inner) {
+      color: green;
+    }
   }
 
   .left_tree {

+ 8 - 5
src/views/saleOrder/index.vue

@@ -13,9 +13,9 @@
       <!-- <plan-statistics></plan-statistics> -->
 
       <el-tabs v-model="activeName" type="card" @tab-click="changeTab">
-        <el-tab-pane label="待排产" name="first"></el-tab-pane>
-        <el-tab-pane label="未完" name="three"></el-tab-pane>
-        <el-tab-pane label="已排产" name="second"></el-tab-pane>
+        <el-tab-pane label="待" name="first"></el-tab-pane>
+        <el-tab-pane label="未完" name="three"></el-tab-pane>
+        <el-tab-pane label="已" name="second"></el-tab-pane>
       </el-tabs>
       <!-- 数据表格 -->
       <ele-pro-table
@@ -24,12 +24,15 @@
         :initLoad="false"
         :datasource="datasource"
         :selection.sync="selection"
-        cache-key="systemRoleTable1"
         height="calc(100vh - 390px)"
+        full-height="calc(100vh - 116px)"
+
+        autoAmendPage
         row-key="id"
         @sort-change="onSortChange"
         @columns-change="handleColumnChange"
         :cacheKey="cacheKeyUrl"
+        :page-size="20"
       >
         <!--   :cache-key="cacheKeyUrl" -->
         <template v-slot:code="{ row }">
@@ -664,7 +667,7 @@
       /* 刷新表格 */
       reload(where) {
         this.$nextTick(() =>
-          this.$refs.table.reload({ page: 1, limit: 10, where })
+          this.$refs.table.reload({ page: 1, where })
         );
       },
 

+ 7 - 3
src/views/saleOrder/salesToProductionNewTwo.vue

@@ -635,7 +635,7 @@
                 label-width="0px"
                 :prop="'salesOrders.' + scope.$index + '.deliveryTime'"
                 :rules="{
-                  required: true,
+                  required: false,
                   message: '请选择客户期望交期',
                   trigger: 'blur'
                 }"
@@ -714,7 +714,6 @@
                       new Date(new Date().setHours(0, 0, 0, 0)).getTime()
                   }"
                   type="date"
-                  disabled
                   placeholder="选择日期"
                   value-format="yyyy-MM-dd"
                 >
@@ -1088,7 +1087,7 @@
       // 验证时间是否超期
       changeDate(item, i) {
         if (this.isTimeAGreaterThanB(item.deliveryTime, item.reqMoldTime)) {
-          this.$message.error('交付时间大于了要求完成日期');
+          this.$message.error('客户期望交期大于了要求完成日期');
         }
       },
       isTimeAGreaterThanB(timeA, timeB) {
@@ -1476,6 +1475,11 @@
           this.$message.warning('请选择工艺路线');
           return;
         }
+        if (!this.form.salesOrders[0]?.reqMoldTime) {
+          flag = false;
+          this.$message.warning('请选择要求完成日期');
+          return;
+        }
         return flag;
       },
       // 对比日期,计算要求生产重量

+ 1 - 1
src/views/workOrder/components/order-search.vue

@@ -137,7 +137,7 @@
             size="mini"
             clearable
             v-model="where.searchInfo"
-            placeholder="请输入查询信息"
+            placeholder="批次号/生产工单号/计划编号/产品编码/产品名称/牌号/型号"
           />
         </el-form-item>
       </el-col>

+ 13 - 3
src/views/workOrder/index.vue

@@ -41,6 +41,9 @@
         @columns-change="handleColumnChange"
         @select-all="selectAll"
         default-expand-all
+        height="calc(100vh - 390px)"
+        full-height="calc(100vh - 116px)"
+        :page-size="20"
       >
         <!-- :key="activeName" -->
         <!-- :selection.sync="selection" -->
@@ -123,7 +126,7 @@
             type="primary"
             @click="toReleaseOpen(row)"
           >
-            派单
+            首工序派单
           </el-link>
           <el-link
             v-if="unpackShow(row) && row.splitResidue !== 0"
@@ -371,7 +374,7 @@
             align: 'center',
             minWidth: 160,
             formatter: (row) => {
-              if (row.list.length) {
+              if (row?.list?.length) {
                 let assignees = row.list.map((item) => item.assignees)?.flat();
                 return assignees?.map((item) => item.assigneeName).join(',');
               }
@@ -494,6 +497,13 @@
           {
             prop: 'formingNum',
             label: '要求生产数量',
+            formatter: (row) => {
+               if(row.measuringUnit){
+                   return `${row.formingNum} ${row.measuringUnit}`
+               }else{
+                 return row.formingNum
+               }
+            },
             align: 'center',
             showOverflowTooltip: true,
             minWidth: 110
@@ -725,7 +735,7 @@
             {
               columnKey: 'action',
               label: '操作',
-              width: 140,
+              width: 200,
               align: 'center',
               resizable: false,
               fixed: 'right',

+ 6 - 3
src/views/workOrder/mixins/release.js

@@ -85,13 +85,16 @@ export default {
       } else {
         id = this.current.taskId;
       }
+      if (this.current?.factoryName) {
+        this.form.factoryName = this.current.factoryName;
+      }
       // this.current.taskId || this.current.firstTaskId;
       console.log(id, 'id 查询工作中心');
       const res = await listWorkCenter(id);
       this.workCenterList = res;
       console.log(this.workCenterList, 'res 333');
       if (res.length > 0) {
-        this.form.factoryName = res[0].factoryName;
+        // this.form.factoryName = res[0].factoryName;
         this.form.workCenterId = res[0].id;
         // 查首工序
         await this.changeWork(res[0].id); // 选择工作中心
@@ -570,7 +573,7 @@ export default {
         }
       } catch (err) {
         this.toolbarLoading = false;
-        this.$message.error(err.message);
+        // this.$message.error(err.message);
       }
     },
     // 下达
@@ -617,7 +620,7 @@ export default {
         })
         .catch((err) => {
           this.toolbarLoading = false;
-          this.$message.error(err.message);
+          // this.$message.error(err.message);
         });
     },
     // 工序选择

+ 1 - 0
vue.config.js

@@ -39,6 +39,7 @@ module.exports = {
         // target: 'http://192.168.1.144:18086',
         // target: 'http://192.168.1.211:18086',
         // target: 'http://192.168.1.251:18186',
+        // target: 'http://192.168.1.102:18086',
 
         target: 'http://192.168.1.125:18086',
 

Algunos archivos no se mostraron porque demasiados archivos cambiaron en este cambio