Browse Source

生产工单

baishaojie 1 month ago
parent
commit
b40bbe2f0b

BIN
dist-CRM-正式地址-20240229-1.zip


BIN
dist-CRM-正式地址-20240416-3.zip


BIN
dist-CRM-正式地址-20240417-1.zip


BIN
dist-CRM-正式地址-20240805-1.zip


BIN
dist-CRM-正式地址-20240808-1.zip


BIN
dist-CRM-正式地址-20241021-1-地址222.zip


BIN
dist-CRM-正式地址-20241029-1.zip


BIN
dist-CRM-测试地址-20240724-1.zip


BIN
dist.zip


+ 1 - 1
src/components/Pagination/index1.vue

@@ -18,7 +18,7 @@
 import { scrollTo } from '@/utils/scroll-to'
 
 export default {
-  name: 'Pagination',
+  name: 'Pagination1',
   props: {
     total: {
       required: true,

+ 101 - 0
src/components/Pagination1/index.vue

@@ -0,0 +1,101 @@
+<template>
+  <div :class="{'hidden':hidden}" class="pagination-container">
+    <el-pagination
+      :background="background"
+      :current-page.sync="currentPage"
+      :page-size.sync="pageSize"
+      :layout="layout"
+      :page-sizes="pageSizes"
+      :total="total"
+      v-bind="$attrs"
+      @size-change="handleSizeChange"
+      @current-change="handleCurrentChange"
+    />
+  </div>
+</template>
+
+<script>
+import { scrollTo } from '@/utils/scroll-to'
+
+export default {
+  name: 'Pagination',
+  props: {
+    total: {
+      required: true,
+      type: Number
+    },
+    page: {
+      type: Number,
+      default: 1
+    },
+    limit: {
+      type: Number,
+      default: 10
+    },
+    pageSizes: {
+      type: Array,
+      default() {
+        return [10, 20, 30, 50, 100]
+      }
+    },
+    layout: {
+      type: String,
+      default: 'total, sizes, prev, pager, next, jumper'
+    },
+    background: {
+      type: Boolean,
+      default: true
+    },
+    autoScroll: {
+      type: Boolean,
+      default: true
+    },
+    hidden: {
+      type: Boolean,
+      default: false
+    }
+  },
+  computed: {
+    currentPage: {
+      get() {
+        return this.page
+      },
+      set(val) {
+        this.$emit('update:page', val)
+      }
+    },
+    pageSize: {
+      get() {
+        return this.limit
+      },
+      set(val) {
+        this.$emit('update:limit', val)
+      }
+    }
+  },
+  methods: {
+    handleSizeChange(val) {
+      this.$emit('pagination', { page: this.currentPage, limit: val })
+      if (this.autoScroll) {
+        scrollTo(0, 800)
+      }
+    },
+    handleCurrentChange(val) {
+      this.$emit('pagination', { page: val, limit: this.pageSize })
+      if (this.autoScroll) {
+        scrollTo(0, 800)
+      }
+    }
+  }
+}
+</script>
+
+<style scoped>
+.pagination-container {
+  background: #fff;
+  padding: 16px 16px;
+}
+.pagination-container.hidden {
+  display: none;
+}
+</style>

+ 2 - 1
src/views/basicData/productList/index.vue

@@ -655,7 +655,8 @@ export default {
         cname: row.cname,
         remark: row.remark,
         sort: row.sort,
-        enable: row.enable
+        enable: row.enable,
+        pImage:row.pImage,
       }
 
 

+ 13 - 2
src/views/productManagement/processConfiguration/index.vue

@@ -191,7 +191,7 @@
                 :default-props="defaultProps"
                 :node-key="nodeKey"
                 :checked-keys="defaultCheckedKeys"
-                @popoverHide="popoverHide"
+                @popoverHide="popoverHideEdit"
                 :disabled="false"
               /> 
             </el-form-item>
@@ -515,7 +515,7 @@ export default {
     handleProcessRecordsCancelAdd(){
         this.dialogProcessRecords = false;
         this.dialogTitle = '';
-        this.processRecordsParammapsParm = {};
+        this.processRecordsParammapsParm = {process: '',  sort: '',remark: ''};
         this.dialogProcessRecordsEdit = false;
     },
     handleProcessRecordsEdit(row){
@@ -584,6 +584,14 @@ export default {
           this.addControlsParm.parammaps.pid ='';
         }
       },
+
+    popoverHideEdit(checkedIds,checkedData) {
+      if (checkedIds !== null) {
+        this.editControlsParm.parammaps.pid = checkedData.id
+      } else {
+        this.editControlsParm.parammaps.pid ='';
+      }
+    },
     handleCancelAdd(){
         this.dialogControlsAdd = false;
         this.dialogTitle = '';
@@ -592,6 +600,8 @@ export default {
     },
     handleControlsAdd(){
         this.dialogControlsAdd = true;
+        this.defaultCheckedKeys = []
+        this.addControlsParm = {name:'addProcess',parammaps:{}};
         this.dialogTitle = '添加生产名称'
     },
     handleControlsAddData(){
@@ -622,6 +632,7 @@ export default {
         this.dialogTitle = '';
     },
     handleNodeClick(data,node){
+      this.list = [];
         if (node.isLeaf) {
             this.pid = data.id;
             this.get_process_records()

+ 410 - 116
src/views/productManagement/productionWorkOrder/index.vue

@@ -29,9 +29,9 @@
         />
 
         <el-select
-          v-model="getProductionWorkOrder.parammaps.goodsEnabled"
+          v-model="getProductionWorkOrder.parammaps.orderStatus"
           clearable
-          placeholder="货品状态"
+          placeholder="处理状态"
           class="filter-item"
           style="width: 150px"
         >
@@ -43,6 +43,23 @@
           />
         </el-select>
 
+
+        <el-select
+          v-model="getProductionWorkOrder.parammaps.priority"
+          clearable
+          placeholder="优先级"
+          class="filter-item"
+          style="width: 150px"
+        >
+          <el-option
+            v-for="item in priorityList"
+            :key="item.name"
+            :label="item.name"
+            :value="item.name"
+          />
+        </el-select>
+
+
         <el-date-picker
           ref="inputDatetime2"
           v-model="getProductionWorkOrder.parammaps.inputDatetime2"
@@ -130,9 +147,44 @@
          
           <el-table-column label="下单人" align="center" prop="orderername" />
           <el-table-column label="下单时间" align="center" prop="orderTime" />
-          <el-table-column label="接单时间" align="center" prop="acceptTime" />
+          <el-table-column label="反馈时间" align="center" prop="acceptTime" />
           <el-table-column label="预估完成时间" align="center" prop="estimatedCompletionTime" />
-          <el-table-column label="距预估时间还剩/天" align="center" prop="days_diff"  sortable />
+          <!-- <el-table-column label="距预估时间还剩/天" align="center" prop="days_diff"  sortable /> -->
+
+          <el-table-column
+  prop="days_diff"
+  label="距预估完成时间还剩"
+  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>
+</el-table-column>
+
           <el-table-column label="实际完成时间" align="center" prop="actualCompletionTime" />
           <el-table-column label="处理状态" align="center" prop="orderStatus" />
           <!-- <el-table-column label="接单人" align="center" prop="acceptername" /> -->
@@ -161,12 +213,12 @@
       </div>
     </div>
 
-    <pagination
+    <Pagination
           v-show="total >= 0"
           :total="total"
           :page.sync="getProductionWorkOrder.offset"
           :limit.sync="getProductionWorkOrder.pagecount"
-          @pagination="get_production_work_order"
+          @Pagination="get_production_work_order"
         />
 
     <el-dialog
@@ -309,16 +361,21 @@
               <el-table-column label="货品图片" align="center">
                 <template slot-scope="scope">
                   <el-popover placement="right" title="" trigger="hover">
-                    <img
-                      slot="reference"
-                      :src="scope.row.goodsImagePath"
-                      style="height: 100px; width: 100px"
-                    />
-                    <img
-                      :src="scope.row.goodsImagePath"
-                      style="height: 200px; width: 200px"
-                    />
-                  </el-popover>
+      <!-- 判断 imagePath 是否存在 -->
+      <template v-if="scope.row.goodsImagePath">
+        <img
+          slot="reference"
+          :src="scope.row.goodsImagePath"
+          style="height: 100px; width: 100px"
+        />
+        <!-- 悬停时显示的内容 -->
+        <img
+          :src="scope.row.goodsImagePath"
+          style="height: 200px; width: 200px"
+        />
+      </template>
+      <template v-else></template>
+    </el-popover>
                 </template>
               </el-table-column>
 
@@ -420,11 +477,25 @@
                   />
                 </template>
               </el-table-column>
+
               <el-table-column
                 label="备注"
                 align="center"
+              >
+                <template slot-scope="{ row }">
+                  <el-input
+                    v-model="row.remark"
+                    placeholder="备注"
+                    clearable
+                    style="padding-right:0px;"
+                  />
+                </template>
+              </el-table-column>
+              <!-- <el-table-column
+                label="备注"
+                align="center"
                 prop="remark"
-              />
+              /> -->
 
               <el-table-column>
                 <template slot-scope="scope">
@@ -465,6 +536,7 @@
             <el-col :span="8">
               <el-form-item label="生产单号:" prop="orderCode">
                 <el-input
+                 :disabled="true"
                   v-model="formLabelAlign.orderCode"
                   placeholder="请输入生产单号"
                 />
@@ -584,16 +656,21 @@
               <el-table-column label="货品图片" align="center">
                 <template slot-scope="scope">
                   <el-popover placement="right" title="" trigger="hover">
-                    <img
-                      slot="reference"
-                      :src="scope.row.goodsImagePath"
-                      style="height: 100px; width: 100px"
-                    />
-                    <img
-                      :src="scope.row.goodsImagePath"
-                      style="height: 200px; width: 200px"
-                    />
-                  </el-popover>
+      <!-- 判断 imagePath 是否存在 -->
+      <template v-if="scope.row.goodsImagePath">
+        <img
+          slot="reference"
+          :src="scope.row.goodsImagePath"
+          style="height: 100px; width: 100px"
+        />
+        <!-- 悬停时显示的内容 -->
+        <img
+          :src="scope.row.goodsImagePath"
+          style="height: 200px; width: 200px"
+        />
+      </template>
+      <template v-else></template>
+    </el-popover>
                 </template>
               </el-table-column>
 
@@ -695,11 +772,37 @@
                   />
                 </template>
               </el-table-column>
+
+              <!-- <el-table-column
+                label="数量"
+                align="center"
+              >
+                <template slot-scope="{ row }">
+                  <el-input
+                    v-model="row.amount"
+                    placeholder="数量"
+                    clearable
+                      type="number"
+                       oninput="value=value.replace(/[^\d]/g,'')"
+                    style="padding-right:0px;"
+                  />
+                </template>
+              </el-table-column> -->
+
+
               <el-table-column
                 label="备注"
                 align="center"
-                prop="remark"
-              />
+              >
+                <template slot-scope="{ row }">
+                  <el-input
+                    v-model="row.remark"
+                    placeholder="备注"
+                    clearable
+                    style="padding-right:0px;"
+                  />
+                </template>
+              </el-table-column>
 
               <el-table-column  label="操作">
                 <template slot-scope="scope">
@@ -728,7 +831,7 @@
         <div style="display: flex; align-items: center;">
           <el-menu
             mode="horizontal"
-            :default-active="activeMenuItem"
+            :default-active="String(activeMenuItem)" 
             @select="handleMenuSelect"
             style="border-bottom: none;"
           >
@@ -737,7 +840,7 @@
           </el-menu>
         </div>
       </template>
-      <div class="app-add" v-if="activeMenuItem == 2">
+      <div class="app-add" v-if="activeMenuItem == 2" >
         <el-form
           ref="form"
           :inline="true"
@@ -1015,6 +1118,39 @@
             </el-col>
           </el-row>
 
+          <el-row :gutter="24"    >
+
+           
+              <el-col :span="8">
+                <el-form-item label="反馈人:">
+                <el-input
+                  v-model="formLabelAlign.acceptername"
+                  :disabled="true"
+                />
+              </el-form-item>
+              </el-col>   
+
+              <el-col :span="8">
+                <el-form-item label="反馈时间:">
+                <el-input
+                  v-model="formLabelAlign.acceptTime"
+                  :disabled="true"
+                />
+              </el-form-item>
+              </el-col>  
+            <el-col  v-if="formLabelAlign.orderStatus==='已关单'" :span="8">
+
+              <el-form-item label="驳回说明:">
+                <el-input
+                  v-model="formLabelAlign.rejectedReason"
+                  :disabled="true"
+                />
+              </el-form-item>
+            </el-col>
+
+         
+          </el-row>
+
           <el-row :gutter="24">
             <el-table
               :key="tableKey"
@@ -1050,6 +1186,15 @@
                 align="center"
                 prop="completedAmount"
               />
+
+              <el-table-column
+                label="剩余量"
+                align="center"
+              >
+              <template #default="scope">
+                {{ scope.row.amount - scope.row.completedAmount }}
+              </template>
+            </el-table-column>
             
               <el-table-column
                 label="备注"
@@ -1062,8 +1207,10 @@
       </div>
 
       <div slot="footer" class="dialog-footer">
-        <el-button class="add-button" v-if="this.formLabelAlign.orderStatus === '未生产'" :style="{ backgroundColor: '#28d251' }" size="mini" @click="handleOrderTaking(scope.row)">反馈</el-button>
+   
+        <el-button class="add-button" v-if="this.formLabelAlign.orderStatus === '未生产'&&isProductionWorkOrderFeedback " :style="{ backgroundColor: '#28d251' }" size="mini" @click="handleOrderTakingById(formLabelAlign)">反馈</el-button>
         <el-button class="add-button" style="background-color: #ffffff; color: black;" @click="handleCancel">关闭</el-button>
+
       </div>
     </el-dialog>
 
@@ -1086,7 +1233,7 @@
           style="width: 90%; margin: 0 auto 30px"
         >
           <el-row :gutter="24" style="display: flex; justify-content: center;">
-            <el-form-item label="接单人:" prop="accepterName">
+            <el-form-item label="反馈人:" prop="accepterName">
               <el-input
                 v-model="isOrderTakingData.accepterName"
                 :disabled="true"
@@ -1095,7 +1242,7 @@
           </el-row>
 
           <el-row :gutter="24" style="display: flex; justify-content: center;">
-            <el-form-item label="接单时间:" prop="acceptTime">
+            <el-form-item label="反馈时间:" prop="acceptTime">
               <el-input
                 v-model="isOrderTakingData.acceptTime"
                 :disabled="true"
@@ -1118,7 +1265,7 @@
       </div>
 
       <div slot="footer" class="dialog-footer" style="display: flex; justify-content: center;">
-        <el-button class="add-button" @click="productionOrderTaking">确认接单</el-button>
+        <el-button class="add-button" @click="productionOrderTaking">确认反馈</el-button>
         <el-button class="add-button" style="background-color: #ffffff; color: black;" @click="handleOrderTakingCancel">关闭</el-button>
       </div>
     </el-dialog>
@@ -1139,7 +1286,7 @@
           label-width="auto"
           style="width: 90%; margin: 0 auto 30px"
         >
-          <el-row :gutter="24">
+          <el-row style=" white-space: nowrap;overflow: hidden;" :gutter="24" >
             <el-col :span="6">
               <el-form-item label="记录人:" style="margin-left: -90px;">
                 <el-input
@@ -1158,7 +1305,7 @@
             </el-col>
 
             <el-col :span="6">
-              <el-form-item label="距完成时间还剩:" style="margin-left: -60px;">
+              <el-form-item label="距完成时间还剩:" style="margin-left: -55px;">
                 <el-input
                   v-model="isFillInDailyData.days_diff"
                   :disabled="true"
@@ -1176,6 +1323,28 @@
             </el-col>
           </el-row>
 
+
+          <el-row :gutter="24">
+            <el-col :span="12">
+              <el-form-item label="日期(最多可选3天):">
+            <el-date-picker
+              v-model="selectedDates"
+              type="dates"
+              placeholder="选择日期(最多可选3天)"
+              format="yyyy-MM-dd"
+              value-format="yyyy-MM-dd"
+              :style="{ width: '400px' }"
+              :picker-options="{
+                disabledDate(time) {
+                  return time.getTime() > Date.now();
+                },
+              }"
+              @change="handleDateChange"
+            />
+          </el-form-item>
+            </el-col>
+          </el-row>
+
           <el-row :gutter="24">
             <el-table
               :key="tableKey"
@@ -1396,7 +1565,7 @@ import {
   ExecDataByConfig,
   GetAccount,transData
 } from '@/api/common';
-import Pagination from '@/components/Pagination';
+import Pagination from '@/components/Pagination1';
 import { MessageBox } from 'element-ui';
 import waves from '@/directive/waves'; // waves directive
 import TreeSelect from '@/components/TreeSelect'; 
@@ -1406,8 +1575,8 @@ export default {
   directives: { waves },
   data() {
     return {
-      getProductionWorkOrder: { name: 'getProductionWorkOrder', page: 1, offset: 1, returntype: 'Map', pagecount: 7, parammaps: {} },
-      getProductionWorkOrderExcel: { name: 'getProductionWorkOrder',  returntype: 'Map', parammaps: {} },
+      getProductionWorkOrder: { name: 'getProductionWorkOrder', page: 1, offset: 1, returntype: 'Map', pagecount: 10, parammaps: {} },
+      getProductionWorkOrderExcel: { name: 'getProductionWorkOrderExcel',  returntype: 'Map', parammaps: {} },
       getOrderCodeParm: { name: 'getOrderCode' },
       getProductionOrderGoodsParm: { name: 'getProductionOrderGoods', parammaps: { id: '' } },
       getProductionOrderGoodsFillOutParm: { name: 'getProductionOrderGoodsFillOut', parammaps: { id: '' } },
@@ -1437,8 +1606,9 @@ export default {
       isTurnDown: false, //接单驳回
       isFillOut: false,
       isProductionRecord: false,
+      dialogTitle : '',
       list: [],
-      activeMenuItem: 1,
+      activeMenuItem: '1',
       listAdd: [],
       workList: [],
       processRecordsList:[],
@@ -1489,6 +1659,7 @@ export default {
       radioAll: '全部',
       pageNum: 0,
       pageSize: 0,
+      selectedDates: [new Date().toISOString().split("T")[0]],
       getGoodsListByCodeParm: { name: 'getGoodsListByCode', parammaps: { goodsCode: "" } },
       delProductionWorkOrder: { name: 'delProductionWorkOrder', parammaps: { id: "" } },
       completeProductionWorkOrder: { name: 'completeProductionWorkOrder', parammaps: { id: "" } },
@@ -1520,7 +1691,44 @@ export default {
     };
   },
   methods: {
- 
+    async handleDateChange(dates) {
+      dates = [...new Set(dates)]; // 去重
+      if (!dates) {
+        this.selectedDates = [];
+        this.productionOrderGoodsList = [];
+        return;
+      }
+
+      // 限制最多选择3天
+      if (dates.length > 3) {
+        this.$message.warning("最多只能选择3天");
+        this.selectedDates = dates.slice(0, 3);
+        dates = this.selectedDates;
+      }
+
+      GetDataByName(this.getProductionOrderGoodsFillOutParm).then((response) => {
+        if (response.data.list == null) {
+          this.productionOrderGoodsList = []
+        } else {
+          for (let index = 0; index < response.data.list.length; index++) {
+            response.data.list[index].remaining = response.data.list[index].totalQuantity - response.data.list[index].producedQuantity ;
+          }
+         
+          this.productionOrderGoodsList = []; // 清空数组
+
+          for (let i = 0; i < dates.length; i++) {
+            for (let index = 0; index < response.data.list.length; index++) {
+              const n = { ...response.data.list[index] }; // 创建副本
+              n.date = dates[i]; // 更新日期字段
+              this.productionOrderGoodsList.push(n); // 添加到结果数组
+            }
+          }
+        }
+      });
+
+
+
+    },
     get_auto_buttons() {
  
     
@@ -1546,6 +1754,7 @@ export default {
         ProductionWorkOrderFillout
       );
       this.isProductionWorkOrderFillout = isProductionWorkOrderFillout;
+console.log(this.isProductionWorkOrderFillout )
 
 const ProductionWorkOrderComplete = "productManagement:productionWorkOrder:complete";
       const isProductionWorkOrderComplete = checkButtons(
@@ -1709,7 +1918,8 @@ const ProductionWorkOrderStart = "productManagement:productionWorkOrder:start";
                   '预估完成时间',
                   '距预估时间还剩/天',
                   '实际完成时间',
-                  '处理状态'
+                  '处理状态',
+                  '备注'
                 ];
 
               const filterVal = [
@@ -1726,8 +1936,10 @@ const ProductionWorkOrderStart = "productManagement:productionWorkOrder:start";
                 'estimatedCompletionTime',
                 'days_diff',
                 'actualCompletionTime',
-                'orderStatus'
+                'orderStatus',
+                'remarks'
               ];
+
               const list1 =  response.data.list;
                 const data1 = this.formatJson(filterVal, list1)
                 excel.export_json_to_excel({
@@ -1769,7 +1981,7 @@ const ProductionWorkOrderStart = "productManagement:productionWorkOrder:start";
     },
 
     startProduction(row){
-      MessageBox.confirm('名称:' + row.orderCode, '确认开始生产?', {
+      MessageBox.confirm( '确认开始生产?', {
         confirmButtonText: '确认',
         cancelButtonText: '取消',
         type: 'warning',
@@ -1812,18 +2024,16 @@ const ProductionWorkOrderStart = "productManagement:productionWorkOrder:start";
     },
     saveProcess(){
       this.isProcess = false;
-console.log()
       if (this.isEdit === true){
         this.processRecordsList=  this.processRecordsList;
         this.processList= [];
       }else{
 
 
-        // listAdd
         this.processRecordsListAdd =  this.processRecordsList;
         for (let index = 0; index < this.processRecordsListAdd.length; index++) {
-          this.processRecordsListAdd[index].amount = this.listAdd[0].totalQuantity
-          
+          this.processRecordsListAdd[index].remark = ''
+            this.processRecordsListAdd[index].amount = this.listAdd[0].totalQuantity ?? 0;
         }
         this.processRecordsList = [];
       }
@@ -1952,13 +2162,23 @@ console.log()
     },
     derive_data() {},
     handleOrderTaking(row) {
-      this.dialogTitle = '确认接单';
+      this.dialogTitle = '确认反馈';
       this.isOrderTaking = true;
       this.isOrderTakingData.acceptTime = this.getDefaultDate();
       this.isOrderTakingData.id = row.id;
       this.isOrderTakingData.accepterId = Cookies.get('employeid');
       this.isOrderTakingData.accepterName = Cookies.get('employename');
     },
+    handleOrderTakingById(row) {
+      console.log(row)
+      this.dialogTitle = '确认反馈';
+      this.isOrderTaking = true;
+      this.isOrderTakingData.acceptTime = this.getDefaultDate();
+      this.isOrderTakingData.id =this.formLabelAlign.id;
+      this.isOrderTakingData.accepterId = Cookies.get('employeid');
+      this.isOrderTakingData.accepterName = Cookies.get('employename');
+      
+    },
 
     productionOrderTaking(row) {
       this.updateProductionOrderTaking.parammaps.id = this.isOrderTakingData.id;
@@ -1976,9 +2196,10 @@ console.log()
           this.isOrderTakingData.accepterId = '';
           this.isOrderTakingData.estimatedCompletionTime = '';
           this.isOrderTaking = false;
+          this.formLabelAlign.orderStatus = '待生产'
           this.$notify({
             title: '成功',
-            message: '删除成功',
+            message: '反馈成功',
             type: 'success',
             duration: 2000,
           });
@@ -1990,6 +2211,7 @@ console.log()
     handleFillInDaily(row) {
       this.dialogTitle = '每日填写';
       this.isFillOut = true;
+      this.selectedDates= [new Date().toISOString().split("T")[0]]
       this.isFillInDailyData.orderername = Cookies.get('employename');
       this.isFillInDailyData.remarks = row.remarks;
       this.isFillInDailyData.days_diff = row.days_diff;
@@ -2207,59 +2429,87 @@ console.log()
       });
     },
     handleEdit(row) {
-      this.get_process_records();
-      this.getProductionOrderGoods(row.id);
-      this.pid = row.id;
-      
-      // this.processRecordsListAdd = this.processRecordsList;
-      this.get_production_order_process_by_pid();
-      this.dialogTitle = '编辑';
-      this.isEdit = true;
-      this.formLabelAlign.id = row.id
-      this.formLabelAlign.orderCode = row.orderCode;
-      this.formLabelAlign.priority = row.priority;
-      this.formLabelAlign.goodsName = row.goodsName;
-      this.formLabelAlign.orderStatus = row.orderStatus;
-      this.formLabelAlign.orderTime = row.orderTime;
-      this.formLabelAlign.orderername = row.orderername;
-      this.formLabelAlign.producedQuantity = row.producedQuantity;
-      this.formLabelAlign.remaining = row.remaining;
-      this.formLabelAlign.remarks = row.remarks;
-      this.formLabelAlign.schedule = row.schedule;
-      this.formLabelAlign.totalQuantity = row.totalQuantity;
-      this.formLabelAlign.days_diff = row.days_diff;
-      this.formLabelAlign.estimatedCompletionTime = row.estimatedCompletionTime;
-      // this.formLabelAlign.createrId = row.days_diff;
-      this.formLabelAlign.createTime =  row.createTime;
-      console.log(this.productionOrderGoodsList);
-      this.formLabelAlign.goodsCode = row.goodsCode
-      this.formLabelAlign.goodsName =row.goodsName
-      this.formLabelAlign.goodsSpecification = row.goodsSpecification
-      this.formLabelAlign.goodsUnit = row.goodsUnit
-      this.formLabelAlign.totalQuantity = row.totalQuantity
-      // this.formLabelAlign.producedQuantity = this.productionOrderGoodsList[0].producedQuantity
-      this.formLabelAlign.date = row.createTime;
-      this.formLabelAlign.createrId  = row.ordererId
-      // console.log( Cookies.get('employeid'), row.ordererId)
-      // this.formLabelAlign.createrId  = Cookies.get('employeid');
-      //  Cookies.get('employeid');
-      this.getProductionOrderProcessParm.parammaps.id = row.id;
-      this.activeList = [
-        { title: '生产下单', status: 'success', name: row.orderername, date: row.orderTime },
-        { title: '生产接单' },
-        { title: '开始生产' },
-        { title: '生产完成' },
-        { title: '生产入库' },
-        { title: '生产接单' }
-      ];
-      this.handleGetProductionOrderProcess()
-    },
+  this.pid = row.id; // 使用 row.id 而不是 id
+  // this.get_process_records();
+  // this.getProductionOrderGoods(row.id);
+  // this.get_production_order_process_by_pid();
+
+  this.productionOrderGoodsList = [];
+  this.getProductionOrderGoodsParm.parammaps.id = row.id; // 这里也要使用 row.id
+  GetDataByName(this.getProductionOrderGoodsParm).then((response) => {
+    if (response.data && response.data.list) {
+      for (let i = 0; i < response.data.list.length; i++) {
+        // response.data.list[index].goodsImagePath = process.env.VUE_APP_BASE_API + response.data.list[index].goodsImagePath;
+
+        if ( response.data.list[i].goodsImagePath !== '') {
+            response.data.list[i].goodsImagePath = process.env.VUE_APP_BASE_API + response.data.list[i].goodsImagePath;
+        } else {
+            response.data.list[i].goodsImagePath = ''
+        }
+      }
+      this.productionOrderGoodsList = response.data.list;
+
+      // this.getProcessRecordsParm.parammaps.pid = this.pid;
+      this.getProductionOrderProcessByPidParm.parammaps.pid = this.pid;
+        GetDataByName(this.getProductionOrderProcessByPidParm).then((response) => {
+          if (response.data && response.data.list) { 
+            this.processRecordsList = response.data.list;
+
+          console.log("processRecordsList:", this.processRecordsList);
+          console.log("productionOrderGoodsList:", this.productionOrderGoodsList);
+          this.dialogTitle = '编辑';
+
+          this.formLabelAlign.id = row.id;
+          this.formLabelAlign.orderCode = row.orderCode;
+          this.formLabelAlign.priority = row.priority;
+          this.formLabelAlign.goodsName = row.goodsName;
+          this.formLabelAlign.orderStatus = row.orderStatus;
+          this.formLabelAlign.orderTime = row.orderTime;
+          this.formLabelAlign.orderername = row.orderername;
+          this.formLabelAlign.producedQuantity = row.producedQuantity;
+          this.formLabelAlign.remaining = row.remaining;
+          this.formLabelAlign.remarks = row.remarks;
+          this.formLabelAlign.schedule = row.schedule;
+          this.formLabelAlign.totalQuantity = row.totalQuantity;
+          this.formLabelAlign.days_diff = row.days_diff;
+          this.formLabelAlign.estimatedCompletionTime = row.estimatedCompletionTime;
+          this.formLabelAlign.createTime = row.createTime;
+          this.formLabelAlign.goodsCode = row.goodsCode;
+          this.formLabelAlign.goodsName = row.goodsName;
+          this.formLabelAlign.goodsSpecification = row.goodsSpecification;
+          this.formLabelAlign.goodsUnit = row.goodsUnit;
+          this.formLabelAlign.totalQuantity = row.totalQuantity;
+          this.formLabelAlign.date = row.createTime;
+          this.formLabelAlign.createrId = row.ordererId;
+
+          this.getProductionOrderProcessParm.parammaps.id = row.id;
+          this.activeList = [
+            { title: '生产下单', status: 'success', name: row.orderername, date: row.orderTime },
+            { title: '生产接单' },
+            { title: '开始生产' },
+            { title: '生产完成' },
+            { title: '生产入库' },
+            { title: '生产接单' }
+          ];
+          this.isEdit = true;
+          this.handleGetProductionOrderProcess();
+
+        } else {
+          this.processRecordsList = [];
+        }
+      });
+    } else {
+      this.productionOrderGoodsList = [];
+    }
+  });
+},
     handleGet(row) {
       this.getProductionOrderGoods(row.id);
       this.pid = row.id;
       this.get_production_order_process_by_pid();
       this.dialogTitle = '查看';
       this.dialogGetVisible = true;
+      this.formLabelAlign.id = row.id;
       this.formLabelAlign.orderCode = row.orderCode;
       this.formLabelAlign.priority = row.priority;
       this.formLabelAlign.goodsName = row.goodsName;
@@ -2269,20 +2519,22 @@ console.log()
       this.formLabelAlign.producedQuantity = row.producedQuantity;
       this.formLabelAlign.remaining = row.remaining;
       this.formLabelAlign.remarks = row.remarks;
-      this.formLabelAlign.schedule = row.schedule;
+      this.formLabelAlign.schedule = row.schedule+'%';
       this.formLabelAlign.totalQuantity = row.totalQuantity;
       this.formLabelAlign.days_diff = row.days_diff;
       this.formLabelAlign.estimatedCompletionTime = row.estimatedCompletionTime;
       this.formLabelAlign.actualCompletionTime=  row.actualCompletionTime;
+      // this.formLabelAlign.remaining =  this.formLabelAlign.amount - this.formLabelAlign.completedAmount
+      this.formLabelAlign.acceptTime=  row.acceptTime;
+      this.formLabelAlign.acceptername=  row.acceptername;
       
-      console.log(this.productionOrderGoodsList);
       this.formLabelAlign.goodsCode = row.goodsCode
       this.formLabelAlign.goodsName =row.goodsName
       this.formLabelAlign.goodsSpecification = row.goodsSpecification
       this.formLabelAlign.goodsUnit = row.goodsUnit
       this.formLabelAlign.totalQuantity = row.totalQuantity
       // this.formLabelAlign.producedQuantity = this.productionOrderGoodsList[0].producedQuantity
-
+      this.formLabelAlign.rejectedReason = row.rejectedReason;
       this.getProductionOrderProcessParm.parammaps.id = row.id;
       this.activeList = [
         { title: '生产下单', status: 'success', name: row.orderername, date: row.orderTime },
@@ -2296,13 +2548,24 @@ console.log()
     },
     handleInputGoods(item) {
       this.getGoodsListByCodeParm.parammaps.goodsCode = item.goodsCode;
-      item.goodsImagePath = process.env.VUE_APP_BASE_API + item.goodsImagePath;
+      // item.goodsImagePath = process.env.VUE_APP_BASE_API + item.goodsImagePath;
+      if ( item.goodsImagePath !== '') {
+        item.goodsImagePath = process.env.VUE_APP_BASE_API + item.goodsImagePath;
+      } else {
+        item.goodsImagePath = ''
+      }
       this.listAdd = [];
       this.listAdd.push(item);
     },
     handleEditInputGoods(item) {
       this.getGoodsListByCodeParm.parammaps.goodsCode = item.goodsCode;
-      item.goodsImagePath = process.env.VUE_APP_BASE_API + item.goodsImagePath;
+      // item.goodsImagePath = process.env.VUE_APP_BASE_API + item.goodsImagePath;
+
+      if ( item.goodsImagePath !== '') {
+        item.goodsImagePath = process.env.VUE_APP_BASE_API + item.goodsImagePath;
+      } else {
+        item.goodsImagePath = ''
+      }
       this.productionOrderGoodsList = [];
       this.productionOrderGoodsList.push(item);
     },
@@ -2329,9 +2592,10 @@ console.log()
       this.getGoodsListByCodeParm.parammaps.goodsCode = '';
       this.listAdd = [];
       this.formLabelAlign.priority = '';
-      console.log(this.formLabelAlign);
+      
       this.formLabelAlign.contractIds = '';
       this.dialogGetVisible = false;
+      this.formLabelAlign =  { orderCode: '', priority: [] }
     },
 
     handleEditAndOff(){
@@ -2530,6 +2794,8 @@ console.log()
       ExecDataByConfig(this.createProductionOrderParm).then(response => {
         if (response.msg !== 'fail') {
           this.get_production_work_order()
+          this.resetForm();
+          this.get_production_work_order();
           this.$notify({
             title: '成功',
             message: '操作成功',
@@ -2538,15 +2804,16 @@ console.log()
           });
         } else {
           this.$notify({
-            title: '失败',
-            message: response.data,
-            type: 'error',
-            duration: 2000,
-          });
+          title: '失败',
+          message: "数据填写不完整,保存失败!",
+          type: 'error',
+          duration: 2000,
+        });
+        return;
         }
       });
-      this.resetForm();
-      this.get_production_work_order();
+      
+    
     },
     handleCancel() {
       this.activeMenuItem = 1;
@@ -2570,8 +2837,13 @@ console.log()
       this.getProductionOrderGoodsParm.parammaps.id = id;
       GetDataByName(this.getProductionOrderGoodsParm).then((response) => {
         if (response.data && response.data.list) {
-          for (let index = 0; index < response.data.list.length; index++) {
-            response.data.list[index].goodsImagePath =  process.env.VUE_APP_BASE_API +response.data.list[index].goodsImagePath;
+          for (let i = 0; i < response.data.list.length; i++) {
+            // response.data.list[index].goodsImagePath =  process.env.VUE_APP_BASE_API +response.data.list[index].goodsImagePath;
+            if ( response.data.list[i].goodsImagePath !== '') {
+                 response.data.list[i].goodsImagePath = process.env.VUE_APP_BASE_API + response.data.list[i].goodsImagePath;
+              } else {
+                response.data.list[i].goodsImagePath = ''
+            }
           }
           this.productionOrderGoodsList = response.data.list;
         } else {
@@ -2600,8 +2872,11 @@ console.log()
           this.pageNum = response.data.pageNum;
           this.pageSize = response.data.pageSize;
           this.total = response.data.total;
+          this.get_auto_buttons();
         } else {
           this.list = [];
+          this.total = 0
+          this.get_auto_buttons();
           this.listLoading = false;
         }
       });
@@ -2649,8 +2924,13 @@ console.log()
     get_goods_list() {
       GetDataByName(this.getGoodsListByCodeParm).then((response) => {
         if (response.data && response.data.list) {
-          for (let index = 0; index < response.data.list.length; index++) {
-            response.data.list[index].goodsImagePath =  process.env.VUE_APP_BASE_API +response.data.list[index].goodsImagePath;
+          for (let i = 0; i < response.data.list.length; i++) {
+            // response.data.list[index].goodsImagePath =  process.env.VUE_APP_BASE_API +response.data.list[index].goodsImagePath;
+            if ( response.data.list[i].goodsImagePath !== '') {
+                 response.data.list[i].goodsImagePath = process.env.VUE_APP_BASE_API + response.data.list[i].goodsImagePath;
+              } else {
+                response.data.list[i].goodsImagePath = ''
+            }
           }
           this.goodsList = response.data.list;
         }
@@ -2658,10 +2938,12 @@ console.log()
     },
   },
   created() {
+ 
     this.get_contract_pull();
     this.get_emp_data();
+    
     this.get_production_work_order();
-    this.get_auto_buttons();
+    
   },
 };
 </script>
@@ -2747,4 +3029,16 @@ console.log()
   right: 10px;
   bottom: 10px; */
 }
+
+.overdue-time {
+    color: #f56c6c;
+    font-size: 15px;
+    font-weight: bold;
+  }
+
+.app-add{
+  white-space: nowrap; /* 防止换行 */
+  overflow: hidden; /* 隐藏溢出内容 */
+  text-overflow: ellipsis; /* 使用省略号表示溢出内容 */
+}
 </style>