baishaojie преди 1 месец
родител
ревизия
1be5421156
променени са 2 файла, в които са добавени 1150 реда и са изтрити 116 реда
  1. 26 2
      src/views/productManagement/assetBasicInfo/index.vue
  2. 1124 114
      src/views/productManagement/productionWorkOrder/index.vue

+ 26 - 2
src/views/productManagement/assetBasicInfo/index.vue

@@ -216,7 +216,6 @@
     :title="dialogTitle"
     :visible.sync="dialogFormVisible"
     :close-on-click-modal="false"
-
      @close="handleCancel"
     :style="{ maxHeight: '100vh', overflowY: 'auto' }"
   >
@@ -384,6 +383,31 @@
    </el-form-item>
                  </el-col>
                  </el-row>
+
+      <el-table
+        :key="tableKey"
+        v-loading="listLoading"
+        element-loading-text="给我一点时间"
+        :data="list"
+        border
+        fit
+        highlight-current-row
+        style="width: 100%;margin-left: 20px;"
+        :row-style="rowStyle"
+        :cell-style="cellStyle"
+        class="elTable  table-fixed"
+        :max-height="myHeight"
+      >
+      <el-table-column
+        label="序号"
+        align="center"
+        type="index"
+        width="50px"
+      />
+
+
+      </el-table>
+
     <!-- </div> -->
     </el-form>
     </div>
@@ -618,7 +642,7 @@ import { getToken } from '@/utils/auth'
                  this.resetInsertForm();
                  this.get_goods_data();
                          this.isEdit= false;
-          this.defaultCheckedKeys=  [];
+                 this.defaultCheckedKeys=  [];
                  this.$notify({
                    title: '成功',
                    message: '操作成功',

+ 1124 - 114
src/views/productManagement/productionWorkOrder/index.vue

@@ -1,130 +1,1140 @@
 <template>
   <div>
-    <h2>生产进度表</h2>
-    <el-table :data="tableData" style="width: 100%">
-      <el-table-column prop="serialNumber" label="序号" width="80"></el-table-column>
-      <el-table-column prop="productionNumber" label="生产编号" width="120"></el-table-column>
-      <el-table-column prop="product" label="商品" width="120"></el-table-column>
-      <el-table-column prop="version" label="收汽版" width="100"></el-table-column>
-      <el-table-column prop="totalQuantity" label="总数量" width="100"></el-table-column>
-      <el-table-column prop="producedQuantity" label="已生产数量" width="120"></el-table-column>
-      <el-table-column prop="remainingQuantity" label="剩余值" width="100"></el-table-column>
-      <el-table-column prop="productionProgress" label="生产进度" width="100"></el-table-column>
-      <el-table-column prop="orderBy" label="下单人" width="100"></el-table-column>
-      <el-table-column prop="orderTime" label="下单时间" width="150"></el-table-column>
-      <el-table-column prop="orderCompletionTime" label="按单时间" width="150"></el-table-column>
-      <el-table-column prop="preparationCompletionTime" label="预制完成时间" width="150"></el-table-column>
-      <el-table-column prop="dailyCompletionRate" label="正常批的完成率/天" width="150"></el-table-column>
-      <el-table-column prop="actualCompletionTime" label="实际完成时间" width="150"></el-table-column>
-      <el-table-column prop="status" label="处理状态" width="120"></el-table-column>
-      <el-table-column prop="remarks" label="备注"></el-table-column>
-    </el-table>
+    <!-- 主内容 -->
+    <div>
+      <div class="app-container">
+        <el-input
+          v-model="getProductionWorkOrder.parammaps.goodsName"
+          placeholder="货品名称"
+          clearable
+          style="width: 150px"
+          class="filter-item"
+        />
+
+        <el-input
+          v-model="getProductionWorkOrder.parammaps.goodsCode"
+          placeholder="货品编码"
+          clearable
+          style="width: 150px"
+          class="filter-item"
+        />
+
+        <el-select
+          v-model="getProductionWorkOrder.parammaps.goodsEnabled"
+          clearable
+          placeholder="货品状态"
+          class="filter-item"
+          style="width: 150px"
+        >
+          <el-option
+            v-for="item in statuesList"
+            :key="item.name"
+            :label="item.name"
+            :value="item.name"
+          />
+        </el-select>
+
+        <el-date-picker
+          ref="inputDatetime2"
+          v-model="getProductionWorkOrder.parammaps.inputDatetime2"
+          class="inputDatetime"
+          type="daterange"
+          style="width: 250px; top: 0px"
+          format="yyyy-MM-dd"
+          value-format="yyyy-MM-dd"
+          range-separator="至"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期"
+        />
+
+        <el-button
+          v-waves
+          class="search-button"
+          type="primary"
+          icon="el-icon-edit"
+          @click="get_production_work_order"
+        >搜索</el-button>
+      </div>
+
+      <div class="search-button-container">
+        <el-button
+          class="search-button"
+          type="primary"
+          icon="el-icon-edit"
+          @click="form_add"
+        >新增生产计划</el-button>
+
+        <el-button
+          class="search-button"
+          type="primary"
+          style="background-color: #00ff15;"
+          icon="el-icon-upload2"
+          @click="derive_data"
+        >导出</el-button>
+
+        <el-radio-group
+          v-model="radioAll"
+          style="margin-top: -5px"
+          @change="changeAll()"
+        >
+          <el-radio-button label="全部" />
+          <el-badge :value="pending.total" class="item">
+            <el-radio-button label="待处理" />
+          </el-badge>
+          <el-radio-button label="已处理" />
+        </el-radio-group>
+      </div>
+
+      <div>
+        <el-table
+          :key="tableKey"
+          v-loading="listLoading"
+          element-loading-text="给我一点时间"
+          :data="list"
+          border
+          fit
+          highlight-current-row
+          style="width: 100%;margin-left: 20px;"
+          :row-style="rowStyle"
+          :cell-style="cellStyle"
+          class="elTable table-fixed"
+          :max-height="myHeight"
+        >
+          <el-table-column label="序号" align="center" type="index" width="50px">
+            <template slot-scope="scope">
+              <span>{{ scope.$index + (pageNum - 1) * pageSize + 1 }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="生产单号" align="center" prop="orderCode" />
+          <el-table-column label="货品" align="center" prop="goodsName" />
+          <el-table-column label="优先级" align="center" prop="priority" />
+          <el-table-column label="总数量" align="center" prop="totalQuantity" />
+          <el-table-column label="已生产数量" align="center" prop="producedQuantity" />
+          <el-table-column label="剩余量" align="center" prop="remaining" />
+          <el-table-column label="生产进度" align="center" prop="schedule" />
+          <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="estimatedCompletionTime" />
+          <el-table-column label="距预估时间还剩/天" align="center" prop="days_diff" />
+          <el-table-column label="实际完成时间" align="center" prop="actualCompletionTime" />
+          <el-table-column label="处理状态" align="center" prop="orderStatus" />
+          <el-table-column label="接单人" align="center" prop="acceptername" />
+          <el-table-column label="备注" align="center" prop="remarks" />
+
+
+          <el-table-column label="操作" min-width="250px" header-align="center" align="center">
+            <template slot-scope="scope">
+              <el-button type="primary" size="mini" @click="handleGet(scope.row)">查看</el-button>
+              <el-button   v-if="scope.row.orderStatus === '待接单'"  :style="{ backgroundColor: '#28d251' }" size="mini" @click="handleOrderTaking(scope.row)">接单</el-button>
+              <el-button   v-if="scope.row.orderStatus === '待接单'"  :style="{ backgroundColor: '#ff3737' }" size="mini" @click="handleOrderTaking(scope.row)">接单驳回</el-button>
+              <el-button   v-if="scope.row.orderStatus === '接单驳回'"  :style="{ backgroundColor: '#5adc79' }" size="mini" @click="handleOrderTaking(scope.row)">编辑</el-button>
+              <el-button   v-if="scope.row.orderStatus === '接单驳回'"  :style="{ backgroundColor: '#ff3737' }" size="mini" @click="handleOrderTaking(scope.row)">删除</el-button>
+              <el-button   v-if="scope.row.orderStatus === '生产中'"  :style="{ backgroundColor: '#eeb47f' }" size="mini" @click="handleOrderTaking(scope.row)">每日填写</el-button>
+              <el-button   v-if="scope.row.orderStatus === '生产中'"  :style="{ backgroundColor:  '#28d251' }" size="mini" @click="handleOrderTaking(scope.row)">完成</el-button>
+              <el-button   v-if="scope.row.orderStatus === '已撤销'"  :style="{ backgroundColor:  '#28d251' }" size="mini" @click="handleOrderTaking(scope.row)">编辑</el-button>
+              <el-button   v-if="scope.row.orderStatus === '已撤销'"  :style="{ backgroundColor: '#ff3737' }" size="mini" @click="handleOrderTaking(scope.row)">删除</el-button>
+            </template>
+          </el-table-column>
+
+        </el-table>
+      </div>
+    </div>
+
+    <!-- 弹窗 -->
+    <el-dialog
+      :title="dialogTitle"
+      :visible.sync="dialogFormVisible"
+      :close-on-click-modal="false"
+      @close="handleCancel"
+      :style="{ maxHeight: '100vh', overflowY: 'auto' }"
+    >
+      <div class="app-add">
+        <el-form
+          ref="form"
+          :rules="rules"
+          :inline="true"
+          :model="formLabelAlign"
+          label-position="left"
+          label-width="auto"
+          style="width: 90%; margin: 0 auto 30px"
+        >
+          <el-row :gutter="24">
+
+            <el-col :span="8">
+              <el-form-item label="生产单号:" prop="orderCode">
+                <el-input
+                  v-model="formLabelAlign.orderCode"
+                  placeholder="请输入生产单号"
+                />
+              </el-form-item>
+            </el-col>
+
+            <el-col :span="8">
+              <el-form-item label=" 录入人:"  prop="createrId">
+                <el-select v-model="formLabelAlign.createrId" placeholder="请选择" :disabled="isView" clearable style="width: 200px">
+                <el-option
+                     v-for="item in empList"
+                     :key="item.id"
+                     :label="item.name"
+                     :value="item.id">
+                   </el-option>
+                 </el-select>
+              </el-form-item>
+            </el-col>
+
+
+          <el-col :span="8">
+            <el-form-item label="下单时间:">
+            <el-date-picker
+                  style="width: 200px"
+                  v-model="formLabelAlign.date"
+                  type="datetime"
+
+               :disabled="isView"
+               align="right"
+                  placeholder="下单时间">
+                </el-date-picker>
+
+
+
+
+            </el-form-item>
+          </el-col>
+          </el-row>
+ <el-row :gutter="24">
+          <el-col :span="8">
+            <el-form-item label=" 优先级:" prop="priority">
+              <el-select v-model="formLabelAlign.priority" placeholder="请选择" :disabled="isView" clearable style="width: 187px">
+              <el-option
+                   v-for="item in priorityList"
+                   :key="item.id"
+                   :label="item.name"
+                   :value="item.id">
+                 </el-option>
+               </el-select>
+            </el-form-item>
+          </el-col>
+
+
+
+    <el-col :span="8">
+            <el-form-item label=" 合同:">
+              <el-select v-model="formLabelAlign.contractIds" placeholder="请选择" multiple  :disabled="isView" clearable style="width: 200px">
+              <el-option
+                   v-for="item in contractList"
+                   :key="item.id"
+                   :label="item.customerName"
+                   :value="item.id">
+                 </el-option>
+               </el-select>
+            </el-form-item>
+          </el-col>
+
+
+          <el-col :span="8">
+            <el-form-item label="备注:" prop="remarks">
+              <el-input
+                v-model="formLabelAlign.remarks"
+                 style="width: 200px"
+              />
+            </el-form-item>
+          </el-col>
+
+          </el-row>
+ <el-row :gutter="24">
+            <el-col :span="18">
+              <el-form-item label="货品:">
+                <el-autocomplete
+                  ref="autocomplete"
+                  v-model="getGoodsListByCodeParm.parammaps.goodsCode"
+                  value-key="id"
+                  :fetch-suggestions="fetchGoods"
+                  placeholder="请输入备件编号或备件名称或备件规格"
+                  style="width: 600px"
+                  @select="handleInputGoods"
+                >
+                  <template slot-scope="{ item }">
+                    <b>备件编号:</b>
+                    <div class="name" style="display: inline">
+                      {{ item.goodsCode }}
+                    </div>
+                    &nbsp; | &nbsp;<b>备件名称:</b><span class="addr">{{ item.goodsName }}</span>&nbsp; | &nbsp;<b>备件规格:</b><span class="addr">{{ item.goodsSpecification }}</span>
+                  </template>
+                </el-autocomplete>
+              </el-form-item>
+            </el-col>
+
+
+          </el-row>
+
+ <el-row :gutter="24">
+            <el-table
+              :key="tableKey"
+              v-loading="listLoading"
+              element-loading-text="给我一点时间"
+              :data="listAdd"
+              border
+              fit
+              highlight-current-row
+              style="width: 100%;margin-left: 20px;"
+              :row-style="rowStyle"
+              :cell-style="cellStyle"
+              class="elTable table-fixed"
+              :max-height="myHeight"
+            >
+            <el-table-column
+              label="序号"
+              align="center"
+              type="index"
+            />
+            <el-table-column
+              label="货品编号"
+              align="center"
+              prop="goodsCode"
+            />
+            <el-table-column
+              label="货品名称"
+              align="center"
+    prop="goodsName"
+            />
+            <el-table-column
+              label="货品规格"
+              align="center"
+    prop="goodsSpecification"
+              />
+            <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>
+              </template>
+            </el-table-column>
+
+
+
+            <el-table-column
+              label="计量单位"
+              align="center"
+
+    prop="label"
+            />
+
+            <el-table-column
+              label="现有库存"
+              align="center"
+            />
+     <el-table-column
+           label="计划生产总量"
+           align="center"
+         >
+           <template slot-scope="{ row }">
+             <el-input
+               v-model="row.totalQuantity"
+               placeholder="计划生产总量"
+               clearable
+              style="padding-right:0px;"
+             />
+           </template>
+         </el-table-column>
+
+ <el-table-column label="优先级" align="center">
+      <template slot-scope="scope">
+        <el-select
+          v-model="scope.row.priority"
+          clearable
+          placeholder="请选择优先级"
+          class="filter-item"
+style="padding-right:0px;"
+        >
+          <el-option
+            v-for="item in priorityList"
+            :key="item.id"
+            :label="item.name"
+            :value="item.id"
+          />
+        </el-select>
+      </template>
+    </el-table-column>
+
+<!--
+            <el-table-column
+              label="操作"
+              align="center"/> -->
+              <el-table-column>
+                 <template slot-scope="scope">
+                   <el-button type="primary" size="mini" @click="handleDel(scope.row)">删除</el-button>
+                 </template>
+              </el-table-column>
+
+
+            </el-table>
+</el-row>
+        </el-form>
+      </div>
+
+        <div  slot="footer" class="dialog-footer">
+      <el-button class="add-button"    @click="handleAddAndOff">保存并关闭</el-button>
+      <el-button class="add-button"   style="background-color: #ffffff; color: black;"  @click="handleCancel">取消并关闭</el-button>
+        </div>
+    </el-dialog>
+
+
+
+    <el-dialog
+          :title="dialogTitle"
+          :visible.sync="dialogGetVisible"
+          :close-on-click-modal="false"
+          @close="handleCancel"
+          :style="{ maxHeight: '100vh', overflowY: 'auto' }"
+        >
+          <div class="app-add">
+            <el-form
+              ref="form"
+              :inline="true"
+              :model="formLabelAlign"
+              label-position="left"
+              label-width="auto"
+              style="width: 90%; margin: 0 auto 30px"
+            >
+              <el-row :gutter="24">
+
+                <el-col :span="8">
+                  <el-form-item label="生产单号:" >
+                    <el-input
+                      v-model="formLabelAlign.orderCode"
+                       :disabled="true"
+
+                    />
+                  </el-form-item>
+                </el-col>
+
+               <el-col :span="8">
+                 <el-form-item label="下单人:" >
+                   <el-input
+                     v-model="formLabelAlign.orderername"
+                      :disabled="true"
+                   />
+                 </el-form-item>
+               </el-col>
+
+                <el-col :span="8">
+                 <el-form-item label="下单时间:" >
+                   <el-input
+                     v-model="formLabelAlign.orderTime"
+                      :disabled="true"
+                   />
+                 </el-form-item>
+               </el-col>
+
+              </el-row>
+
+ <el-row :gutter="24">
+            <el-col :span="8">
+                 <el-form-item label="优先级:" >
+                   <el-input
+                     v-model="formLabelAlign.priority"
+                      :disabled="true"
+                   />
+                 </el-form-item>
+               </el-col>
+
+               <el-col :span="8">
+                 <el-form-item label="合同:" >
+                   <el-input
+                     v-model="formLabelAlign.orderername"
+                      :disabled="true"
+                   />
+                 </el-form-item>
+               </el-col>
+
+               <el-col :span="8">
+                 <el-form-item label="总数量:" >
+                   <el-input
+                     v-model="formLabelAlign.totalQuantity"
+                      :disabled="true"
+                   />
+                 </el-form-item>
+               </el-col>
+    </el-row>
+
+ <el-row :gutter="24">
+            <el-col :span="8">
+                 <el-form-item label="已生产数量:" >
+                   <el-input
+                     v-model="formLabelAlign.producedQuantity"
+                      :disabled="true"
+                   />
+                 </el-form-item>
+               </el-col>
+
+               <el-col :span="8">
+                 <el-form-item label="剩余量:" >
+                   <el-input
+                     v-model="formLabelAlign.remaining"
+                      :disabled="true"
+                   />
+                 </el-form-item>
+               </el-col>
+
+               <el-col :span="8">
+                 <el-form-item label="生产进度:" >
+                   <el-input
+                     v-model="formLabelAlign.schedule"
+                      :disabled="true"
+                   />
+                 </el-form-item>
+               </el-col>
+    </el-row>
+
+    <el-row :gutter="24">
+               <el-col :span="8">
+                    <el-form-item label="接单时间:" >
+                      <el-input
+                        v-model="formLabelAlign.acceptTime"
+                         :disabled="true"
+                      />
+                    </el-form-item>
+                  </el-col>
+
+                  <el-col :span="8">
+                    <el-form-item label="预估完成时间:" >
+                      <el-input
+                        v-model="formLabelAlign.estimatedCompletionTime"
+                         :disabled="true"
+                      />
+                    </el-form-item>
+                  </el-col>
+
+                  <el-col :span="8">
+                    <el-form-item label="距预估时间还剩:" >
+                      <el-input
+                        v-model="formLabelAlign.days_diff"
+                         :disabled="true"
+                      />
+                    </el-form-item>
+                  </el-col>
+       </el-row>
+
+    <el-row :gutter="24">
+               <el-col :span="8">
+                    <el-form-item label="实际完成时间:" >
+                      <el-input
+                        v-model="formLabelAlign.actualCompletionTime"
+                         :disabled="true"
+                      />
+                    </el-form-item>
+                  </el-col>
+
+                  <el-col :span="8">
+                    <el-form-item label="备注:" >
+                      <el-input
+                        v-model="formLabelAlign.remarks"
+                        :disabled="true"
+                      />
+                    </el-form-item>
+                  </el-col>
+
+       </el-row>
+
+     <el-row :gutter="24">
+                <el-table
+                  :key="tableKey"
+                  v-loading="listLoading"
+                  element-loading-text="给我一点时间"
+                  :data="productionOrderGoodsList"
+                  border
+                  fit
+                  highlight-current-row
+                  style="width: 100%;margin-left: 20px;"
+                  :row-style="rowStyle"
+                  :cell-style="cellStyle"
+                  class="elTable table-fixed"
+                  :max-height="myHeight"
+                >
+                <el-table-column
+                  label="序号"
+                  align="center"
+                  type="index"
+                />
+                <el-table-column
+                  label="货品编号"
+                  align="center"
+                  prop="goodsCode"
+                />
+                <el-table-column
+                  label="货品名称"
+                  align="center"
+        prop="goodsName"
+                />
+                <el-table-column
+                  label="货品规格"
+                  align="center"
+        prop="goodsSpecification"
+                  />
+                <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>
+                  </template>
+                </el-table-column>
+
+
+
+                <el-table-column
+                  label="计量单位"
+                  align="center"
+
+        prop="label"
+                />
+
+                <el-table-column
+                  label="现有库存"
+                  align="center"
+                />
+
+     <el-table-column
+                      label="计划生产总量"
+                      align="center"
+            prop="totalQuantity"
+                    />
+
+            <el-table-column
+                      label="优先级"
+                      align="center"
+            prop="priority" />
+                </el-table>
+    </el-row>
+            </el-form>
+          </div>
+
+<el-form-item label="流程进度" />
+
+ <el-steps :active="active" align-center finish-status="success">
+                  <el-step
+                    v-for="(item, index) in activeList"
+                    :key="index"
+                    :title="item.title"
+                    :status="item.status"
+                  >
+                    <template slot="description">
+                      <div class="step-row">
+                        <div>{{ item.name }}&nbsp;&nbsp;{{ item.date }}</div>
+                        <div>{{ item.reason }}</div>
+                      </div>
+                    </template>
+                  </el-step>
+                </el-steps>
+
+
+            <div  slot="footer" class="dialog-footer">
+          <el-button class="add-button"    @click="handleAddAndOff">保存并关闭</el-button>
+          <el-button class="add-button"   style="background-color: #ffffff; color: black;"  @click="handleCancel">取消并关闭</el-button>
+            </div>
+        </el-dialog>
+
+        <el-dialog
+              :title="dialogTitle"
+              :visible.sync="isOrderTaking"
+              :close-on-click-modal="false"
+              @close="handleOrderTakingCancel"
+
+              :width="600 + 'px'"
+              :style="{ maxHeight: '100vh', overflowY: 'auto' }"
+            >
+            <div class="app-add">
+              <el-form
+                ref="form"
+                :rules="rules1"
+                :inline="true"
+                :model="isOrderTakingData"
+                label-position="center"
+                label-width="auto"
+                style="width: 90%; margin: 0 auto 30px"
+              >
+
+              <el-row :gutter="24"  style="display: flex; justify-content: center;">
+                     <el-form-item label="接单人:"  prop="accepterName">
+                       <el-input
+                         v-model="isOrderTakingData.accepterName"
+                         :disabled="true"
+                       />
+                     </el-form-item>
+                   </el-row>
+
+ <el-row :gutter="24"  style="display: flex; justify-content: center;">
+        <el-form-item label="接单时间:"  prop="acceptTime">
+          <el-input
+            v-model="isOrderTakingData.acceptTime"
+            :disabled="true"
+          />
+        </el-form-item>
+      </el-row>
+
+
+      <el-row :gutter="24"  style="display: flex; justify-content: center;">
+             <el-form-item label="预估完成时间:"  prop="estimatedCompletionTime">
+               <el-date-picker
+                type="date"
+                 style="width: 187px"
+                 v-model="isOrderTakingData.estimatedCompletionTime"
+                 :disabled="false"
+               />
+             </el-form-item>
+           </el-row>
+
+
+
+
+
+
+</el-form>
+  </div>
+
+  <div  slot="footer" class="dialog-footer" style="display: flex; justify-content: center;">
+         <el-button class="add-button"    @click="handleAddAndOff">确认接单</el-button>
+         <el-button class="add-button"   style="background-color: #ffffff; color: black;"  @click="handleOrderTakingCancel">关闭</el-button>
+  </div>
+
+        </el-dialog>
   </div>
+
 </template>
 
 <script>
+
+import 'element-ui/lib/theme-chalk/index.css';
+  import Cookies from 'js-cookie'
+import {
+  GetDataByName,
+  postJson,
+  GetDataByNames,
+  partslistSGv2,
+  PostDataByName,
+  ExecDataByConfig,
+  GetAccount
+} from '@/api/common'
+import Pagination from '@/components/Pagination'
+import { MessageBox } from 'element-ui'
+import waves from '@/directive/waves' // waves directive
 export default {
+  components: { Pagination },
+  directives: { waves },
   data() {
     return {
-      tableData: [
-        {
-          serialNumber: 1,
-          productionNumber: 'B20120030100',
-          product: '轿车车轮换发厂',
-          version: '高色',
-          totalQuantity: 10000,
-          producedQuantity: 6000,
-          remainingQuantity: 4000,
-          productionProgress: '60%',
-          orderBy: '3pcs',
-          orderTime: '2024-10-25 15:00',
-          orderCompletionTime: '2024-10-25 18:00',
-          preparationCompletionTime: '2024-11-08',
-          dailyCompletionRate: '2',
-          actualCompletionTime: '',
-          status: '待售单',
-          remarks: ''
+      getProductionWorkOrder: {  name: 'getProductionWorkOrder', page: 1,   offset: 1, returntype: 'Map',  pagecount: 7,  parammaps: { }  },
+         getOrderCodeParm: {  name: 'getOrderCode'},
+         getProductionOrderGoodsParm :{name:'getProductionOrderGoods',parammaps:{id:''}},
+      pending:{},
+      empList :[],
+      productionOrderGoodsList:[],
+         activeList: [],
+      tableKey :0,
+        active: 1,
+       listLoading: true,
+          isView : false,
+       dialogFormVisible :false,
+       dialogGetVisible :false,
+        isOrderTaking : false, //接单
+        list:[],
+        listAdd:[],
+        priorityList:[
+          { id: '紧张', name: '紧张' },
+          { id: '高', name: '高' },
+           { id: '一般', name: '一般' }
+        ],
+        rules: {
+          orderCode: [
+            { required: true, message: '货品编码不能为空', trigger: 'blur' },
+          ],
+          createrId: [
+            { required: true, message: '创建人不能为空', trigger: 'blur' },
+          ],
+          priority: [
+            { required: true, message: '优先级不能为空', trigger: 'blur' },
+          ],
         },
-        {
-          serialNumber: 2,
-          productionNumber: 'B20120030100',
-          product: '轿车',
-          version: '高色',
-          totalQuantity: 10000,
-          producedQuantity: null,
-          remainingQuantity: null,
-          productionProgress: '3pcs',
-          orderBy: '3pcs',
-          orderTime: '2024-09-20 16:00',
-          orderCompletionTime: '2024-09-20 18:00',
-          preparationCompletionTime: '2024-10-08',
-          dailyCompletionRate: '',
-          actualCompletionTime: '2024-10-10',
-          status: '按单记录',
-          remarks: ''
+        rules1:{
+          estimatedCompletionTime: [
+            { required: true, message: '预估完成时间不能为空', trigger: 'blur' },
+          ],
+          acceptTime: [
+            { required: true, message: '接单时间不能为空', trigger: 'blur' },
+          ],
+          accepterName: [
+            { required: true, message: '接单人不能为空', trigger: 'blur' },
+          ],
         },
-        {
-          serialNumber: 3,
-          productionNumber: 'B20120030100',
-          product: '轿车',
-          version: '高色',
-          totalQuantity: 10000,
-          producedQuantity: 1000,
-          remainingQuantity: 5000,
-          productionProgress: '10%',
-          orderBy: '3pcs',
-          orderTime: '2024-08-14 15:00',
-          orderCompletionTime: '2024-08-14 17:00',
-          preparationCompletionTime: '2024-09-08',
-          dailyCompletionRate: '10',
-          actualCompletionTime: '2024-09-08',
-          status: '生产中',
-          remarks: ''
-        },
-        {
-          serialNumber: 4,
-          productionNumber: 'B20120030100',
-          product: '轿车',
-          version: '高色',
-          totalQuantity: 10000,
-          producedQuantity: 5000,
-          remainingQuantity: 9990,
-          productionProgress: '5%',
-          orderBy: '3pcs',
-          orderTime: '2024-07-08 15:00',
-          orderCompletionTime: '2024-07-08 19:00',
-          preparationCompletionTime: '2024-08-08',
-          dailyCompletionRate: '20',
-          actualCompletionTime: '',
-          status: '生产中',
-          remarks: ''
-        },
-        {
-          serialNumber: 4,
-          productionNumber: 'B20120030100',
-          product: '轿车',
-          version: '一般',
-          totalQuantity: 10000,
-          producedQuantity: 0,
-          remainingQuantity: 0,
-          productionProgress: '0%',
-          orderBy: '3pcs',
-          orderTime: '2024-06-05 15:00',
-          orderCompletionTime: '2024-06-05 21:00',
-          preparationCompletionTime: '2024-07-08',
-          dailyCompletionRate: '30',
-          actualCompletionTime: '',
-          status: '已购单',
-          remarks: ''
-        }
-      ]
+        goodsList:[],
+        createProductionOrderParm :{},
+        getEmployeesSelectParm :{name:'getEmployeesSelect'},
+       formLabelAlign:{orderCode:'',priority:[]},
+       isOrderTakingData :{acceptTime:''},
+          myHeight: document.documentElement.clientHeight - 85 - 250,
+          rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
+          cellStyle: { padding: 0 + 'px' },
+       radioAll: '全部',
+       pageNum: 0,
+       pageSize: 0,
+         getGoodsListByCodeParm: {name :'getGoodsListByCode',parammaps:{ goodsCode:""}},
+
+       getOrderCode : {name :'getOrderCode'},
+       getContractPullParm: {name :'getContractPull'},
+       contractList:[],
+    statuesList: [
+      { id: '0', name: '待接单' },
+      { id: '1', name: '生产中' },
+      { id: '2', name: '已完成' },
+      { id: '3', name: '已撤销' },
+      { id: '4', name: '接单驳回' }
+    ],
     };
-  }
+  },
+  methods: {
+    form_search(){
+
+    },
+    changeAll (){
+
+    },
+    derive_data(){
+
+    },
+    handleOrderTaking(row){
+      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');
+    },
+    handleOrderTakingCancel(){
+      this.dialogTitle = '';
+      this.isOrderTaking = false;
+    },
+    handleDel(row){
+      console.log(this.listAdd)
+      MessageBox.confirm('设备名称:' + row.goodsName, '确认删除?', {
+        confirmButtonText: '确认',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        // console.log(this.list2)
+        for (var i = 0; i < this.listAdd.length; i++) {
+          console.log(this.listAdd[i])
+          if (this.listAdd[i].id === row.id) {
+            var listAddIndex = this.listAdd.indexOf(this.listAdd[i])
+          }
+          if (listAddIndex > -1) {
+            this.listAdd.splice(listAddIndex, 1)
+            return
+          }
+        }
+      })
+    },
+    fetchGoods(queryString, cb) {
+      this.getGoodsListByCodeParm.parammaps.goodsCode = queryString;
+      GetDataByName(this.getGoodsListByCodeParm).then((response) => {
+        if (response.data.list == null) {
+          cb([])
+        } else {
+          cb(response.data.list)
+        }
+      });
+    },
+    handleGet(row){
+      this.dialogTitle = '查看';
+      this.dialogGetVisible = true;
+      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.getProductionOrderGoods(row.id);
+
+      this.activeList = [
+            {title: '生产下单',   status: 'success' ,name:row.orderername,date :row.orderTime},
+            { title: '生产接单' },
+            { title: '开始生产' },
+            { title: '生产完成' },
+            { title: '生产入库' },
+            { title: '生产接单' }
+          ]
+      console.log(row);
+    },
+    handleInputGoods(item){
+     this.getGoodsListByCodeParm.parammaps.goodsCode = item.goodsCode;
+     item.goodsImagePath = process.env.VUE_APP_BASE_API + item.goodsImagePath;
+     this.listAdd.push(item);
+    },
+    form_add(){
+
+      this.dialogTitle = "新增工单";
+      this.get_order_code();
+            this.formLabelAlign.createrId = Cookies.get('employeid');
+      this.dialogFormVisible = true;
+       this.formLabelAlign.date = this.getDefaultDate();
+
+    },
+    getDefaultDate() {
+         const date = new Date();
+              const year = date.getFullYear();
+              const month = String(date.getMonth() + 1).padStart(2, '0');
+              const day = String(date.getDate()).padStart(2, '0');
+              const hours = String(date.getHours()).padStart(2, '0');
+              const minutes = String(date.getMinutes()).padStart(2, '0');
+              const seconds = String(date.getSeconds()).padStart(2, '0');
+              return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
+      },
+       resetForm() {
+          this.dialogFormVisible = false;
+          this.formLabelAlign.orderCode = '';
+          this.getGoodsListByCodeParm.parammaps.goodsCode = '';
+          this.listAdd = [];
+          this.formLabelAlign.priority = '';
+          console.log(this.formLabelAlign);
+          this.formLabelAlign.contractIds = '';
+          this.dialogGetVisible = false;
+      },
+
+      handleAddAndOff(){
+
+        if (this.listAdd.length  ===  0){
+          this.$notify({
+            title: '失败',
+            message: "货品不能为空!",
+            type: 'error',
+            duration: 2000,
+          });
+          return ;
+        }
+
+        if (this.formLabelAlign.priority  ===  ''){
+          this.$notify({
+            title: '失败',
+            message: "优先级不能为空!",
+            type: 'error',
+            duration: 2000,
+          });
+          return ;
+        }
+    this.createProductionOrderParm = {
+          data: [
+              {
+                  name: "createProductionOrder",
+                  type: "e",
+                  parammaps: {
+                      orderCode: this.formLabelAlign.orderCode,
+                      priority: this.formLabelAlign.priority,
+                      contractIds:   (this.formLabelAlign.contractIds || []).join(","),
+                      ordererId: this.formLabelAlign.createrId,
+                      orderTime: this.formLabelAlign.date,
+                      remarks:this.formLabelAlign.remarks
+                  }
+              },
+              {
+                  name: "insertProductionOrderGoods",
+                  resultmaps: {
+                      list: this.listAdd
+                      },
+                  children: [
+                      {
+                          name: "insertProductionOrderGoods",
+                          type: "e",
+                          parammaps: {
+                              productionOrderId: "@createProductionOrder.LastInsertId",
+                              goodsId: "@insertProductionOrderGoods.id",
+                              priority: "@insertProductionOrderGoods.priority",
+                              totalQuantity: "@insertProductionOrderGoods.totalQuantity"
+                          }
+                      }
+                  ]
+              }
+          ]
+      }
+            ExecDataByConfig(this.createProductionOrderParm).then(response => {
+               if (response.msg !== 'fail') {
+                 this.$notify({
+                   title: '成功',
+                   message: '操作成功',
+                   type: 'success',
+                   duration: 2000,
+                 });
+               } else {
+                 this.$notify({
+                   title: '失败',
+                   message: response.data,
+                   type: 'error',
+                   duration: 2000,
+                 });
+               }
+             });
+        this.resetForm();
+        this.get_production_work_order();
+      },
+    handleCancel(){
+      this.resetForm();
+    },
+    get_emp_data(){
+      GetDataByName(this.getEmployeesSelectParm).then((response) => {
+        if (response.data && response.data.list) {
+          this.empList = response.data.list;
+        }else{
+         this.empList = [];
+        }
+      });
+    },
+    getProductionOrderGoods(id){
+      this.productionOrderGoodsList  = [];
+      this.getProductionOrderGoodsParm.parammaps.id = id;
+      GetDataByName(this.getProductionOrderGoodsParm).then((response) => {
+        if (response.data && response.data.list) {
+          this.productionOrderGoodsList = response.data.list;
+        }else{
+         this.list = [];
+          this.listLoading = false;
+        }
+      });
+    },
+   get_production_work_order() {
+
+  if (
+        this.getProductionWorkOrder.parammaps.inputDatetime2 !== undefined &&
+        this.getProductionWorkOrder.parammaps.inputDatetime2 !== null
+       ) {
+         this.getProductionWorkOrder.parammaps.startDate = this.getProductionWorkOrder.parammaps.inputDatetime2[0]
+         this.getProductionWorkOrder.parammaps.endDate = this.getProductionWorkOrder.parammaps.inputDatetime2[1]
+       } else {
+         this.getProductionWorkOrder.parammaps.startDate = ''
+         this.getProductionWorkOrder.parammaps.endDate = ''
+       }
+
+     GetDataByName(this.getProductionWorkOrder).then((response) => {
+       if (response.data && response.data.list) {
+         this.list = response.data.list;
+         this.listLoading = false;
+        this.pageNum =  response.data.pageNum
+        this.pageSize  =   response.data.pageSize
+         this.total = response.data.total
+       }else{
+        this.list = [];
+         this.listLoading = false;
+       }
+
+
+     });
+   },
+    get_order_code() {
+      GetDataByName(this.getOrderCodeParm).then((response) => {
+        if (response.data && response.data.list) {
+          console.log(response.data.list[0].generated_code);
+          this.formLabelAlign.orderCode = response.data.list[0].generated_code;
+          console.log( this.formLabelAlign.orderCode);
+        }
+      });
+    },
+    get_contract_pull(){
+      GetDataByName(this.getContractPullParm).then((response) => {
+        if (response.data && response.data.list) {
+          console.log(response.data.list[0].generated_code);
+          this.contractList = response.data.list;
+
+        }
+      });
+    },
+
+    get_goods_list(){
+      GetDataByName(this.getGoodsListByCodeParm).then((response) => {
+        if (response.data && response.data.list) {
+          this.goodsList = response.data.list;
+        }
+      });
+    },
+  },
+  created() {
+    this.get_contract_pull();
+    this.get_emp_data();
+     this.get_production_work_order();
+  },
 };
 </script>
 
-<style scoped>
-h2 {
-  margin-bottom: 20px;
+<style>
+.app-container {
+  padding: 10px;
+   margin-left: 10px;
+}
+
+.search-button-container {
+  padding: 10px;
+  padding-left: 20px;
+}
+
+.search-button {
+   padding: 10px 20px;
+       border: 0.01px solid #ccc; /* 黑色边框,宽度为 2px */
+        margin-left: 10px;
+}
+
+.add-button {
+  background-color: #2196f3; /* 绿色背景 */
+  color: white; /* 白色文字 */
+  padding: 10px 20px; /* 内边距 */
+
+  border-radius: 5px; /* 圆角 */
+  cursor: pointer; /* 鼠标悬停时显示手型 */
+  font-size: 16px; /* 字体大小 */
+  transition: background-color 0.3s ease; /* 背景颜色过渡效果 */
+  padding: 8px 12px;
+  margin: 15px 30px;
+    border: 0.01px solid #ccc; /* 黑色边框,宽度为 2px */
+}
+
+
+
+.dialog-footer{
+  right:10px;
+  position:absolute;
+  bottom:10px;
+}
+
+.el-step__head.is-success {
+  color: #409eff;
+  border-color: #409eff;
+}
+.el-step__title.is-success {
+  color: #409eff;
+}
+.el-step__head.is-process {
+  color: #409eff;
+  border-color: #409eff;
+  .el-step__icon.is-text {
+    background: #409eff;
+    color: #fff;
+  }
 }
-</style>
+</style>