guoyujia 1 vuosi sitten
vanhempi
commit
621365a24e

+ 3 - 4
src/views/business/process/form.vue

@@ -28,10 +28,10 @@
 <script setup>
 import { getProcess, saveProcess } from '@/api/business/process'
 const { proxy } = getCurrentInstance()
-const { process_status } = proxy.useDict('process_status')
-
 const emit = defineEmits(['handleSaveSuccess'])
-
+/** 字典数组区 */
+const { process_status } = proxy.useDict('process_status')
+/** 工序表单变量 */
 const loading = ref(false)
 const visible = ref(false)
 const data = reactive({
@@ -51,7 +51,6 @@ function open(id) {
   getProcess(id || 0).then((res) => {
     if (res.data) {
       form.value = res.data
-      console.log(form.value)
     }
   })
 }

+ 3 - 6
src/views/business/process/index.vue

@@ -5,7 +5,6 @@
       <el-form-item class="section-title" label="标准工序" />
       <el-form-item>
         <el-button type="primary" icon="Plus" @click="handleShowProcessDialog(null)" v-hasPermi="['system:product:add']">新增</el-button>
-        <!-- <el-button type="success" icon="Refresh" @click="handleRefreshProcess">刷新</el-button> -->
       </el-form-item>
     </el-form>
 
@@ -13,7 +12,6 @@
     <div class="el-table-container">
       <div class="el-table-inner-container">
         <el-table v-loading="loading" :data="processList" height="100%" @selection-change="handleSelectionChange">
-          <!-- <el-table-column type="selection" width="40" align="center" /> -->
           <el-table-column label="行号" type="index" width="50" align="center" />
           <el-table-column label="工序编码" width="100" align="center" prop="processCode" />
           <el-table-column label="工序简称" width="100" align="center" prop="processAlias" />
@@ -38,7 +36,7 @@
     <!-- 分页 -->
     <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
 
-    <!-- 表单 -->
+    <!-- 新增工序表单 -->
     <process-form ref="processRef" @handleSaveSuccess="handleRefreshProcess" />
   </div>
 </template>
@@ -47,10 +45,9 @@
 import { listProcess, delProcess } from '@/api/business/process'
 import processForm from './form'
 const { proxy } = getCurrentInstance()
-const { process_status } = proxy.useDict('process_status')
 /** 字典数组区 */
-/** 查询 对象 */
-
+const { process_status } = proxy.useDict('process_status')
+/** 标准工序*/
 const processList = ref([])
 const loading = ref(true)
 const ids = ref([])

+ 3 - 32
src/views/business/product/DialogProcessChoice.vue

@@ -24,10 +24,8 @@
             @keyup.enter="handleSearch"
           />
         </el-form-item>
-  
         <el-form-item label-width="20px" style="margin-top: 20px;">
           <el-button type="info" icon="Search" @click="handleSearch">搜索</el-button>
-          <!-- <el-button type="primary" icon="Delete"  plain @click="handleSearch('clear')">清空</el-button> -->
         </el-form-item>
       </div>
     </el-form>
@@ -68,28 +66,18 @@
 import { ref } from '@vue/reactivity'
 import { listProcess } from '@/api/business/process'
 const { proxy } = getCurrentInstance()
+/** 字典数组区 */
 const { process_status } = proxy.useDict('process_status')
+/** 工序变量 */
 const total = ref(0)
 const props = defineProps({
-  multiple: {
-    type: Boolean,
-    default: false
-  },
-  selected: {
-    type: Array,
-    defalut: []
-  },
-  singleSelected: {
-    type: Function,
-    default: null
-  },
   multipleSelected: {
     type: Function,
     default: null
   }
 })
 
-const { singleSelected, multipleSelected, selected } = toRefs(props)
+const { multipleSelected } = toRefs(props)
 const processList = ref([])
 const visible = ref(false)
 const loading = ref(false)
@@ -142,17 +130,9 @@ function getList() {
  * 列表checkbox列选择 事件
  */
 function handleSelectionChange(selection) {
-  console.log(selection)
   selections.value = selection
 }
 
-function selectable(row, index) {
-  if (selected.value.length > 0) {
-    return !selected.value.some((l) => l.personId === row.id)
-  } else {
-    return true
-  }
-}
 
 /**  搜索 事件 */
 function handleSearch(type) {
@@ -167,15 +147,6 @@ function handleSearch(type) {
   }
   getList()
 }
-
-/** 单选事件 */
-function handleSingleSelected(row) {
-  if (singleSelected.value) {
-    singleSelected.value(row)
-  }
-  close()
-}
-
 /** 多选事件 */
 function handleMultipleSelected() {
   if (multipleSelected.value) {

+ 1 - 1
src/views/business/product/form.vue

@@ -167,7 +167,7 @@ const { product_type } = proxy.useDict("product_type");
 const { product_dtype } = proxy.useDict("product_dtype");
 const { product_status_code } = proxy.useDict("product_status_code");
 const { production_type_code } = proxy.useDict("production_type_code");
-
+/** 产品表单变量 */
 const loading = ref(false);
 const visible = ref(false);
 const data = reactive({

+ 654 - 334
src/views/business/product/index.vue

@@ -2,40 +2,116 @@
   <div class="page-container column-container">
     <section class="list-part-container column-container" style="flex: 1">
       <!-- 搜索区 -->
-      <el-form class="list-search-container" :model="queryParams" ref="queryRef" :inline="true">
+      <el-form
+        class="list-search-container"
+        :model="queryParams"
+        ref="queryRef"
+        :inline="true"
+      >
         <el-form-item class="section-title" label="产品管理" />
         <el-form-item label="产品类别:">
-          <el-select v-model="queryParams.type" clearable placeholder="请选择类别" style="width: 130px">
-            <el-option v-for="dict in product_type" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
+          <el-select
+            v-model="queryParams.type"
+            clearable
+            placeholder="请选择类别"
+            style="width: 130px"
+          >
+            <el-option
+              v-for="dict in product_type"
+              :key="dict.value"
+              :label="dict.label"
+              :value="dict.value"
+            ></el-option>
           </el-select>
         </el-form-item>
         <el-form-item label="客户集团简称:">
-          <el-input placeholder="请输入客户集团简称" v-model.trim="queryParams.companyAlias" style="width: 150px" clearable @keyup.enter="handleQuery" @keydown.enter.prevent />
+          <el-input
+            placeholder="请输入客户集团简称"
+            v-model.trim="queryParams.companyAlias"
+            style="width: 150px"
+            clearable
+            @keyup.enter="handleQueryProduct"
+            @keydown.enter.prevent
+          />
         </el-form-item>
         <el-form-item label="图号:">
-          <el-input placeholder="请输入产品图号" v-model.trim="queryParams.drawingNumber" style="width: 130px" clearable @keyup.enter="handleQuery" @keydown.enter.prevent />
+          <el-input
+            placeholder="请输入产品图号"
+            v-model.trim="queryParams.drawingNumber"
+            style="width: 130px"
+            clearable
+            @keyup.enter="handleQueryProduct"
+            @keydown.enter.prevent
+          />
         </el-form-item>
         <el-form-item label="规格:">
-          <el-input placeholder="请输入产品规格" v-model.trim="queryParams.specification" style="width: 130px" clearable @keyup.enter="handleQuery" @keydown.enter.prevent />
+          <el-input
+            placeholder="请输入产品规格"
+            v-model.trim="queryParams.specification"
+            style="width: 130px"
+            clearable
+            @keyup.enter="handleQueryProduct"
+            @keydown.enter.prevent
+          />
         </el-form-item>
         <el-form-item label="料号:">
-          <el-input placeholder="请输入产品料号" v-model.trim="queryParams.productCode" style="width: 130px" clearable @keyup.enter="handleQuery" @keydown.enter.prevent />
+          <el-input
+            placeholder="请输入产品料号"
+            v-model.trim="queryParams.productCode"
+            style="width: 130px"
+            clearable
+            @keyup.enter="handleQueryProduct"
+            @keydown.enter.prevent
+          />
         </el-form-item>
         <el-form-item label="产品描述:">
-          <el-input placeholder="请输入产品描述" v-model.trim="queryParams.description" style="width: 130px" clearable @keyup.enter="handleQuery" @keydown.enter.prevent />
+          <el-input
+            placeholder="请输入产品描述"
+            v-model.trim="queryParams.description"
+            style="width: 130px"
+            clearable
+            @keyup.enter="handleQueryProduct"
+            @keydown.enter.prevent
+          />
         </el-form-item>
         <el-form-item>
-          <el-button type="info" icon="Search" @click="handleQuery">搜索</el-button>
-          <el-button type="primary" icon="Plus" @click="handleAdd" v-hasPermi="['business:product:add']">新增</el-button>
-          <el-button type="primary" icon="Refresh" @click="handleSync" v-hasPermi="['business:product:sync']">同步P2产品</el-button>
+          <el-button type="info" icon="Search" @click="handleQueryProduct"
+            >搜索</el-button
+          >
+          <el-button
+            type="primary"
+            icon="Plus"
+            @click="handleAddProduct"
+            v-hasPermi="['business:product:add']"
+            >新增</el-button
+          >
+          <el-button
+            type="primary"
+            icon="Refresh"
+            @click="handleSync"
+            v-hasPermi="['business:product:sync']"
+            >同步P2产品</el-button
+          >
         </el-form-item>
       </el-form>
       <!-- 列表区 -->
       <div class="el-table-container">
         <div class="el-table-inner-container">
-          <el-table ref="productTable" v-loading="productLoading" :data="productList" row-key="id" highlight-current-row height="100%" @current-change="handleCurrentProductChange">
-            <!-- <el-table-column type="selection" width="40" align="center" /> -->
-            <el-table-column type="index" label="行号" width="50" align="center" />
+          <el-table
+            ref="productTable"
+            v-loading="productLoading"
+            :data="productList"
+            row-key="id"
+            highlight-current-row
+            height="100%"
+            @current-change="handleCurrentProductChange"
+          >
+            <el-table-column
+              type="index"
+              label="行号"
+              width="50"
+              align="center"
+            />
             <el-table-column label="料号" align="center" prop="productCode" />
             <el-table-column label="预入仓库" align="center" prop="preStock" />
             <el-table-column label="类别" align="center" prop="type">
@@ -43,39 +119,119 @@
                 <dict-tag :options="product_type" :value="scope.row.type" />
               </template>
             </el-table-column>
-            <el-table-column label="轴类型大类" width="150px" align="center" prop="shaftBroadCategoryCode">
+            <el-table-column
+              label="轴类型大类"
+              width="150px"
+              align="center"
+              prop="shaftBroadCategoryCode"
+            >
               <template #default="scope">
-                <dict-tag :options="product_dtype" :value="scope.row.shaftBroadCategoryCode" />
+                <dict-tag
+                  :options="product_dtype"
+                  :value="scope.row.shaftBroadCategoryCode"
+                />
               </template>
             </el-table-column>
-            <el-table-column label="轴类型" align="center" prop="shaftCategoryCode" />
+            <el-table-column
+              label="轴类型"
+              align="center"
+              prop="shaftCategoryCode"
+            />
             <el-table-column label="规格" align="center" prop="specification" />
-            <el-table-column label="图号" align="center" width="110" prop="drawingNumber" />
-            <el-table-column label="客户集团简称" align="center" width="120px" prop="companyAlias" />
-            <el-table-column label="产品描述" align="center" width="200px" prop="description" />
+            <el-table-column
+              label="图号"
+              align="center"
+              width="110"
+              prop="drawingNumber"
+            />
+            <el-table-column
+              label="客户集团简称"
+              align="center"
+              width="120px"
+              prop="companyAlias"
+            />
+            <el-table-column
+              label="产品描述"
+              align="center"
+              width="200px"
+              prop="description"
+            />
             <el-table-column label="直径" align="center" prop="diameter" />
             <el-table-column label="成品长度" align="center" prop="lenght" />
             <el-table-column label="厚度" align="center" prop="thickness" />
-            <el-table-column label="客户代号" align="center" prop="companyCode" />
-            <el-table-column label="销售员编码" align="center" prop="salesmanCode" />
-            <el-table-column label="保管员编码" align="center" prop="stockKeeperCode" />
-            <el-table-column label="调度员编号" align="center" prop="dispatcherCode" />
+            <el-table-column
+              label="客户代号"
+              align="center"
+              prop="companyCode"
+            />
+            <el-table-column
+              label="销售员编码"
+              align="center"
+              prop="salesmanCode"
+            />
+            <el-table-column
+              label="保管员编码"
+              align="center"
+              prop="stockKeeperCode"
+            />
+            <el-table-column
+              label="调度员编号"
+              align="center"
+              prop="dispatcherCode"
+            />
             <el-table-column label="备注" align="center" prop="remark" />
-            <el-table-column label="产品状态" align="center" prop="productStatusCode">
+            <el-table-column
+              label="产品状态"
+              align="center"
+              prop="productStatusCode"
+            >
               <template #default="scope">
-                <dict-tag :options="product_status_code" :value="scope.row.productStatusCode" />
+                <dict-tag
+                  :options="product_status_code"
+                  :value="scope.row.productStatusCode"
+                />
               </template>
             </el-table-column>
-            <el-table-column label="生产类型" align="center" prop="productionTypeCode">
+            <el-table-column
+              label="生产类型"
+              align="center"
+              prop="productionTypeCode"
+            >
               <template #default="scope">
-                <dict-tag :options="production_type_code" :value="scope.row.productionTypeCode" />
+                <dict-tag
+                  :options="production_type_code"
+                  :value="scope.row.productionTypeCode"
+                />
               </template>
             </el-table-column>
-            <el-table-column label="技术员编码" align="center" prop="technicianCode" />
-            <el-table-column fixed="right" label="操作" align="center" width="140px">
+            <el-table-column
+              label="技术员编码"
+              align="center"
+              prop="technicianCode"
+            />
+            <el-table-column
+              fixed="right"
+              label="操作"
+              align="center"
+              width="140px"
+            >
               <template #default="scope">
-                <el-button link type="warning" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['business:product:edit']">编辑</el-button>
-                <el-button link type="danger" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['business:product:remove']">删除</el-button>
+                <el-button
+                  link
+                  type="warning"
+                  icon="Edit"
+                  @click="handleUpdateProduct(scope.row)"
+                  v-hasPermi="['business:product:edit']"
+                  >编辑</el-button
+                >
+                <el-button
+                  link
+                  type="danger"
+                  icon="Delete"
+                  @click="handleDelete(scope.row)"
+                  v-hasPermi="['business:product:remove']"
+                  >删除</el-button
+                >
               </template>
             </el-table-column>
           </el-table>
@@ -83,49 +239,116 @@
       </div>
     </section>
     <!-- 分页 -->
-    <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
+    <pagination
+      v-show="total > 0"
+      :total="total"
+      v-model:page="queryParams.pageNum"
+      v-model:limit="queryParams.pageSize"
+      @pagination="getList"
+    />
 
     <section class="list-part-container row-container" style="flex: 1">
       <section class="list-part-container" style="flex: 1">
         <!-- 下边页面开始 -->
-        <el-form class="list-search-container" :model="queryParams" ref="queryRef" :inline="true">
+        <el-form
+          class="list-search-container"
+          :model="queryParams"
+          ref="queryRef"
+          :inline="true"
+        >
           <el-form-item class="section-title" label="标准工艺" />
           <el-form-item>
-            <el-button type="primary" icon="Plus" @click="handleAddTechnologicalProcess" v-hasPermi="['business:product:add']" :disabled="!currentProduct.id">
+            <el-button
+              type="primary"
+              icon="Plus"
+              @click="handleAddTechnologicalProcess"
+              v-hasPermi="['business:product:add']"
+              :disabled="!currentProduct.id"
+            >
               添加工艺
             </el-button>
-            <el-button type="danger" icon="Delete" @click="TechnologicalProcessDelete" :disabled="technologicalProcessIds.length === 0" v-hasPermi="['business:product:remove']">
+            <el-button
+              type="danger"
+              icon="Delete"
+              @click="TechnologicalProcessDelete"
+              :disabled="technologicalProcessIds.length === 0"
+              v-hasPermi="['business:product:remove']"
+            >
               删除工艺
             </el-button>
           </el-form-item>
         </el-form>
         <div class="el-table-container">
           <div class="el-table-inner-container">
-            <el-table ref="technologicalProcessTable" :data="technologicalProcessList ? technologicalProcessList : []" v-loading="technologicalProcessLoading" :row-key="getRowKey" highlight-current-row height="100%" size="small" header-row-class-name="list-header-row" @selection-change="TechnologicalProcessSelectionChange" @current-change="handleCurrentTechnologicalProcessChange">
+            <el-table
+              ref="technologicalProcessTable"
+              :data="technologicalProcessList ? technologicalProcessList : []"
+              v-loading="technologicalProcessLoading"
+              :row-key="getRowKey"
+              highlight-current-row
+              height="100%"
+              size="small"
+              header-row-class-name="list-header-row"
+              @selection-change="TechnologicalProcessSelectionChange"
+              @current-change="handleCurrentTechnologicalProcessChange"
+            >
               <el-table-column type="selection" width="40" align="center" />
-              <el-table-column type="index" label="行号" width="50" align="center" />
-              <el-table-column label="工艺版本" align="center" prop="technologyVersion">
+              <el-table-column
+                type="index"
+                label="行号"
+                width="50"
+                align="center"
+              />
+              <el-table-column
+                label="工艺版本"
+                align="center"
+                prop="technologyVersion"
+              >
                 <template #default="scope">
                   <div v-if="scope.row.editStatus">
-                    <el-input v-model.trim="scope.row.technologyVersion" size="small" placeholder="工艺版本" />
+                    <el-input
+                      v-model.trim="scope.row.technologyVersion"
+                      size="small"
+                      placeholder="工艺版本"
+                    />
                   </div>
                   <div v-else>{{ scope.row.technologyVersion }}</div>
                 </template>
               </el-table-column>
               <el-table-column label="操作" width="140px" align="center">
                 <template #default="scope">
-                  <el-button v-if="scope.row.editStatus" link type="primary" icon="Check" @click="
+                  <el-button
+                    v-if="scope.row.editStatus"
+                    link
+                    type="primary"
+                    icon="Check"
+                    @click="
                       handleSaveTechnologicalProcess(scope.row, scope.$index)
-                    " v-hasPermi="['business:product:add']">
+                    "
+                    v-hasPermi="['business:product:add']"
+                  >
                     保存
                   </el-button>
 
-                  <el-button v-else link type="warning" icon="Edit" @click.prevent="scope.row.editStatus = true" v-hasPermi="['business:product:edit']">
+                  <el-button
+                    v-else
+                    link
+                    type="warning"
+                    icon="Edit"
+                    @click.prevent="scope.row.editStatus = true"
+                    v-hasPermi="['business:product:edit']"
+                  >
                     编辑
                   </el-button>
-                  <el-button link type="danger" icon="Delete" @click="
+                  <el-button
+                    link
+                    type="danger"
+                    icon="Delete"
+                    @click="
                       handleDeleteTechnologicalProcess(scope.row, scope.$index)
-                    " v-hasPermi="['business:product:remove']">
+                    "
+                    v-hasPermi="['business:product:remove']"
+                  >
                     删除
                   </el-button>
                 </template>
@@ -135,57 +358,149 @@
         </div>
       </section>
       <section class="list-part-container" style="flex: 1">
-        <el-form class="list-search-container list-search-container-child" :model="queryParams" ref="queryRef" :inline="true">
+        <el-form
+          class="list-search-container list-search-container-child"
+          :model="queryParams"
+          ref="queryRef"
+          :inline="true"
+        >
           <el-form-item class="section-title" label="标准工序" />
           <el-form-item>
-            <el-button v-if="!editStatus" @click="handleTechnologicalProcessDetailEdit" :disabled="
+            <el-button
+              v-if="!editStatus"
+              @click="handleTechnologicalProcessDetailEdit"
+              :disabled="
                 technologicalProcessList.length === 0 ||
                 currentTechnologicalProcess.id == null
-              " v-hasPermi="['business:product:edit']" type="warning" icon="Edit">
+              "
+              v-hasPermi="['business:product:edit']"
+              type="warning"
+              icon="Edit"
+            >
               编辑
             </el-button>
             <template v-if="editStatus">
-              <el-button type="primary" icon="Plus" @click="handleAddProcess" v-hasPermi="['business:product:add']" :disabled="!currentTechnologicalProcess.id">
+              <el-button
+                type="primary"
+                icon="Plus"
+                @click="handleAddProcess"
+                v-hasPermi="['business:product:add']"
+                :disabled="!currentTechnologicalProcess.id"
+              >
                 添加工序
               </el-button>
-              <el-button type="danger" @click="handleTechnologicalProcessCancel" v-hasPermi="['business:product:edit']" icon="Close">取消编辑</el-button>
+              <el-button
+                type="danger"
+                @click="handleTechnologicalProcessCancel"
+                v-hasPermi="['business:product:edit']"
+                icon="Close"
+                >取消编辑</el-button
+              >
             </template>
-            <el-button type="success" v-if="editStatus" icon="Check" :disabled="technologicalprocessDetailList.length === 0" v-hasPermi="['business:product:add']" @click="handleTechnologicalProcessDetailAdd">保存</el-button>
-            <el-button type="danger" icon="Delete" v-if="!editStatus" @click="handledelTechnologicalProcessDetail" :disabled="technologicalProcessDetailIds.length === 0" v-hasPermi="['business:product:remove']">
+            <el-button
+              type="success"
+              v-if="editStatus"
+              icon="Check"
+              :disabled="technologicalprocessDetailList.length === 0"
+              v-hasPermi="['business:product:add']"
+              @click="handleTechnologicalProcessDetailAdd"
+              >保存</el-button
+            >
+            <el-button
+              type="danger"
+              icon="Delete"
+              v-if="!editStatus"
+              @click="handledelTechnologicalProcessDetail"
+              :disabled="technologicalProcessDetailIds.length === 0"
+              v-hasPermi="['business:product:remove']"
+            >
               删除工序
             </el-button>
           </el-form-item>
         </el-form>
         <div class="el-table-container">
           <div class="el-table-inner-container">
-            <el-table :data="technologicalprocessDetailList" v-loading="technologicalprocessDetailLoading" :row-key="getRowKey" highlight-current-row height="100%" @selection-change="processDetailSelectionChange">
+            <el-table
+              :data="technologicalprocessDetailList"
+              v-loading="technologicalprocessDetailLoading"
+              :row-key="getRowKey"
+              highlight-current-row
+              height="100%"
+              @selection-change="processDetailSelectionChange"
+            >
               <el-table-column type="selection" width="40" align="center" />
-              <el-table-column type="index" label="行号" width="50" align="center" />
-              <el-table-column label="工序步骤编号" width="100" align="center" prop="processStepNumber">
+              <el-table-column
+                type="index"
+                label="行号"
+                width="50"
+                align="center"
+              />
+              <el-table-column
+                label="工序步骤编号"
+                width="100"
+                align="center"
+                prop="processStepNumber"
+              >
                 <template #default="scope">
                   <div v-if="scope.row.editStatus || editStatus">
-                    <el-input v-model.trim="scope.row.processStepNumber" size="small" placeholder="工序步骤编号" />
+                    <el-input
+                      v-model.trim="scope.row.processStepNumber"
+                      size="small"
+                      placeholder="工序步骤编号"
+                    />
                   </div>
                   <div v-else>{{ scope.row.processStepNumber }}</div>
                 </template>
               </el-table-column>
-              <el-table-column label="工序编码" align="center" prop="processCode" />
-              <el-table-column label="工序简称" align="center" prop="processAlias" />
-              <!-- <el-table-column label="图纸" prop="drawingFile" align="center" /> -->
-              <el-table-column v-if="!editStatus" label="操作" width="140px" align="center">
+              <el-table-column
+                label="工序编码"
+                align="center"
+                prop="processCode"
+              />
+              <el-table-column
+                label="工序简称"
+                align="center"
+                prop="processAlias"
+              />
+              <el-table-column
+                v-if="!editStatus"
+                label="操作"
+                width="140px"
+                align="center"
+              >
                 <template #default="scope">
-                  <el-button v-if="scope.row.editStatus && !editStatus" link type="primary" icon="Check" @click="handleSaveTechnologicalProcessDetail(scope.row)" v-hasPermi="['business:product:add']">
+                  <el-button
+                    v-if="scope.row.editStatus && !editStatus"
+                    link
+                    type="primary"
+                    icon="Check"
+                    @click="handleSaveTechnologicalProcessDetail(scope.row)"
+                    v-hasPermi="['business:product:add']"
+                  >
                     保存
                   </el-button>
-                  <el-button v-else-if="!editStatus && !scope.row.editStatus" link type="warning" icon="Edit" @click.prevent="scope.row.editStatus = true" v-hasPermi="['business:product:edit']">
+                  <el-button
+                    v-else-if="!editStatus && !scope.row.editStatus"
+                    link
+                    type="warning"
+                    icon="Edit"
+                    @click.prevent="scope.row.editStatus = true"
+                    v-hasPermi="['business:product:edit']"
+                  >
                     编辑
                   </el-button>
-                  <el-button link type="danger" icon="Delete" @click="
+                  <el-button
+                    link
+                    type="danger"
+                    icon="Delete"
+                    @click="
                       handleDeleteTechnologicalProcessDetail(
                         scope.row,
                         scope.$index
                       )
-                    " v-hasPermi="['business:product:remove']">
+                    "
+                    v-hasPermi="['business:product:remove']"
+                  >
                     删除
                   </el-button>
                 </template>
@@ -195,44 +510,55 @@
         </div>
       </section>
     </section>
-    <!-- 表单 -->
-    <product-form ref="productRef" @handleSaveSuccess="handleQueryProduct"></product-form>
-    <process-choice ref="processChoiceRef" :multiple="true" :multiple-selected="handleProcessSelected"></process-choice>
+    <!-- 产品表单 -->
+    <product-form
+      ref="productRef"
+      @handleSaveSuccess="handleQueryProduct"
+    ></product-form>
+    <!-- 工序弹窗 -->
+    <process-choice
+      ref="processChoiceRef"
+      :multiple-selected="handleProcessSelected"
+    ></process-choice>
   </div>
 </template>
 
 <script setup>
-import { listProduct, delProduct } from '@/api/business/product'
-import { getP2Product } from '@/api/business/p2.js'
-import productForm from './form'
-import processChoice from './DialogProcessChoice'
-import { listTechnologicalProcessDetail, saveTechnologicalProcessDetail, delTechnologicalProcessDetail, saveSingleTechnologicalProcessDetail } from '@/api/business/technologicalProcessDetail'
-import { listTechnologicalProcess, saveTechnologicalProcess, delTechnologicalProcess } from '@/api/business/technologicalProcess'
-import { ref } from 'vue'
-const { proxy } = getCurrentInstance()
+import { listProduct, delProduct } from "@/api/business/product";
+import { getP2Product } from "@/api/business/p2.js";
+import productForm from "./form";
+import processChoice from "./DialogProcessChoice";
+import {
+  listTechnologicalProcessDetail,
+  saveTechnologicalProcessDetail,
+  delTechnologicalProcessDetail,
+  saveSingleTechnologicalProcessDetail,
+} from "@/api/business/technologicalProcessDetail";
+import {
+  listTechnologicalProcess,
+  saveTechnologicalProcess,
+  delTechnologicalProcess,
+} from "@/api/business/technologicalProcess";
+import { ref } from "vue";
+const { proxy } = getCurrentInstance();
 /** 字典数组区 */
-const { product_type } = proxy.useDict('product_type')
-const { product_dtype } = proxy.useDict('product_dtype')
-const { product_status_code } = proxy.useDict('product_status_code')
-const { production_type_code } = proxy.useDict('production_type_code')
+const { product_type } = proxy.useDict("product_type");
+const { product_dtype } = proxy.useDict("product_dtype");
+const { product_status_code } = proxy.useDict("product_status_code");
+const { production_type_code } = proxy.useDict("production_type_code");
 
-/** 查询 对象 */
-const productList = ref([])
-const technologicalProcessList = ref([])
-const technologicalprocessDetailList = ref([])
-const productLoading = ref(false)
-const technologicalProcessLoading = ref(false)
-const technologicalprocessDetailLoading = ref(false)
-const ids = ref([])
-const deleteIds = ref([])
-const technologicalProcessIds = ref([])
-const technologicalProcessDetailIds = ref([])
-const single = ref(true)
-const multiple = ref(true)
-const editStatus = ref(false)
-const technologicalProcessAddMultiple = ref(true)
-
-const total = ref(0)
+/** 产品变量 */
+const productList = ref([]);
+const productLoading = ref(false);
+const ids = ref([]);
+const total = ref(0);
+const currentProduct = ref({});
+/** 工艺变量 */
+const technologicalProcessList = ref([]);
+const technologicalProcessLoading = ref(false);
+const technologicalProcessIds = ref([]);
+const currentTechnologicalProcess = ref({});
+const technologicalProcessAddMultiple = ref(true);
 const detailsRow = {
   id: null,
   tenantId: null,
@@ -240,343 +566,337 @@ const detailsRow = {
   productCode: undefined,
   productShaftCategory: undefined,
   productShaftCategoryName: undefined,
-  productDescription: undefined
-}
-const currentProduct = ref({})
-const currentTechnologicalProcess = ref({})
+  productDescription: undefined,
+};
+/** 工序变量 */
+const technologicalprocessDetailList = ref([]);
+const technologicalprocessDetailLoading = ref(false);
+const technologicalProcessDetailIds = ref([]);
+const single = ref(true);
+const editStatus = ref(false);
 
 /** 查询对象 */
 const queryParams = ref({
   pageNum: 1,
   pageSize: 10,
-  code: '',
-  name: '',
+  code: "",
+  name: "",
   combinedValue: null,
-  productCode: ''
-})
+  productCode: "",
+});
 
 /***********************  方法区  ****************************/
-
+/***********************  产品管理  ****************************/
 /** 查询产品管理列表
  * 进入页面产品表第一条和工艺表第一条默认选中
  */
 function getList() {
-  productLoading.value = true
+  productLoading.value = true;
   listProduct(queryParams.value).then((response) => {
-    productList.value = response.rows
-    total.value = response.total
-    productLoading.value = false
+    productList.value = response.rows;
+    total.value = response.total;
+    productLoading.value = false;
     if (productList.value.length > 0) {
-      proxy.$refs.productTable.setCurrentRow(productList.value[0])
-    } else {
-      technologicalProcessList.value = []
-      technologicalprocessDetailList.value = []
-    }
-  })
-}
-
-const handleQueryProduct = () => {
-  getList()
-}
-// 获取工艺列表
-const getTechnologicalProcesses = (index) => {
-  technologicalProcessLoading.value = true
-  listTechnologicalProcess({ productId: currentProduct.value.id }).then((res) => {
-    technologicalProcessList.value = res.rows
-    technologicalProcessLoading.value = false
-    if (technologicalProcessList.value.length > 0) {
-      proxy.$refs.technologicalProcessTable.setCurrentRow(technologicalProcessList.value[index])
+      proxy.$refs.productTable.setCurrentRow(productList.value[0]);
     } else {
-      technologicalProcessList.value = []
-      technologicalprocessDetailList.value = []
+      technologicalProcessList.value = [];
+      technologicalprocessDetailList.value = [];
     }
-  })
-}
-
-// 获取工序列表
-const getTechnologicalProcessDetails = () => {
-  if (!currentTechnologicalProcess.value.id) {
-    technologicalprocessDetailList.value = []
-  } else {
-    technologicalprocessDetailLoading.value = true
-    listTechnologicalProcessDetail({
-      technologicalProcessId: currentTechnologicalProcess.value.id
-    }).then((res) => {
-      technologicalprocessDetailList.value = res.rows
-      technologicalprocessDetailLoading.value = false
-    })
-  }
+  });
 }
-
 /**
  * 产品的 current change 事件
  * 要获取工艺列表
  */
 function handleCurrentProductChange(row) {
   if (row) {
-    currentProduct.value = row
-    editStatus.value = false
-    getTechnologicalProcesses(0)
+    currentProduct.value = row;
+    editStatus.value = false;
+    getTechnologicalProcesses(0);
   }
 }
+/** 产品搜索按钮操作 */
+function handleQueryProduct() {
+  queryParams.value.pageNum = 1;
+  getList();
+}
+/** 产品新增按钮操作 */
+function handleAddProduct() {
+  proxy.$refs.productRef.open();
+}
+
+/** 产品修改按钮操作 */
+function handleUpdateProduct(row) {
+  const id = row.id || ids.value;
+  proxy.$refs.productRef.open(id);
+}
+/** 删除产品表操作 */
+function handleDelete(row) {
+  const _ids = row.id;
+  proxy.$modal
+    .confirm("是否确认删除选中的数据项?")
+    .then(function () {
+      delProduct(_ids).then(() => {
+        getList();
+        proxy.$modal.msgSuccess("删除成功!");
+      });
+    })
+    .catch(() => {});
+}
 
+/***********************  标准工艺  ****************************/
+// 获取工艺列表
+const getTechnologicalProcesses = (index) => {
+  technologicalProcessLoading.value = true;
+  listTechnologicalProcess({ productId: currentProduct.value.id }).then(
+    (res) => {
+      technologicalProcessList.value = res.rows;
+      technologicalProcessLoading.value = false;
+      if (technologicalProcessList.value.length > 0) {
+        proxy.$refs.technologicalProcessTable.setCurrentRow(
+          technologicalProcessList.value[index]
+        );
+      } else {
+        technologicalProcessList.value = [];
+        technologicalprocessDetailList.value = [];
+      }
+    }
+  );
+};
 /**
  * 工艺的 current change 事件
  * 要获取工序列表
  */
 function handleCurrentTechnologicalProcessChange(row) {
-  editStatus.value = false
+  editStatus.value = false;
   if (row) {
-    technologicalProcessAddMultiple.value = true
-    technologicalprocessDetailLoading.value = true
-    currentTechnologicalProcess.value = row
-
-    technologicalProcessAddMultiple.value = false
+    technologicalProcessAddMultiple.value = true;
+    technologicalprocessDetailLoading.value = true;
+    currentTechnologicalProcess.value = row;
+    technologicalProcessAddMultiple.value = false;
+    getTechnologicalProcessDetails();
+  } else {
+    technologicalprocessDetailList.value = [];
+  }
+  technologicalprocessDetailLoading.value = false;
+}
+/** 工艺表多选框选中数据 */
+function TechnologicalProcessSelectionChange(selection) {
+  technologicalProcessIds.value = selection.map((item) => item.id);
+  single.value = selection.length != 1;
+}
+/**
+ * 工艺保存 事件
+ * 添加工艺操作:添加后,执行刷新操作,重新查找工艺表内容,并通过绑定添加行的下标来选中,从而获得row
+ */
+function handleSaveTechnologicalProcess(row, index) {
+  if (!row.technologyVersion) {
+    proxy.$modal.msgError("工艺版本不能为空!");
+  } else {
+    if (
+      row.technologyVersion !== "A" &&
+      row.technologyVersion !== "B" &&
+      row.technologyVersion !== "C"
+    ) {
+      proxy.$modal.msgError("工艺版本只能填写A、B、C");
+    } else {
+      row.productId = currentProduct.value.id;
+      saveTechnologicalProcess(row).then((response) => {
+        if (response.code == 200) {
+          getTechnologicalProcesses(index);
+          proxy.$modal.msgSuccess("操作成功!");
+        }
+      });
+      row.editStatus = false;
+    }
+  }
+}
+/** 工艺添加操作 */
+const handleAddTechnologicalProcess = () => {
+  const newDetail = JSON.parse(JSON.stringify(detailsRow));
+  newDetail.editStatus = true;
+  newDetail.productCode = currentProduct.value.productCode;
+  newDetail.productId = currentProduct.value.id;
+  newDetail.productShaftCategoryId = currentProduct.value.shaftCategoryId;
+  newDetail.productDrawingNumber = currentProduct.value.drawingNumber;
+  newDetail.productDescription = currentProduct.value.description;
+  newDetail.productSpecification = currentProduct.value.specification;
+  newDetail.tenantId = currentProduct.value.tenantId;
+  newDetail.technologyVersion = "";
+  technologicalProcessList.value.push(newDetail);
+};
+/** 工艺添加取消操作 */
+const handleSync = () => {
+  productLoading.value = true;
+  getP2Product(queryParams.value).then((res) => {
+    getList();
+  });
+};
 
-    getTechnologicalProcessDetails()
+/** 单条删除工艺操作
+ * 删除已经存在的数据-即row.id存在,执行一个对话框选择,如果确认则执行删除方法,并重新查询工艺表操作,
+ * 让工艺表第一条默认选中
+ * 删除未保存的苏剧-即row.id不存在,通过splice方法,通过下标删除数组的元素
+ */
+function handleDeleteTechnologicalProcess(row, index) {
+  if (row.id) {
+    proxy.$modal
+      .confirm("是否确认删除选中的数据项?")
+      .then(function () {
+        return delTechnologicalProcess(row.id);
+      })
+      .then(() => {
+        getTechnologicalProcesses(0);
+        proxy.$modal.msgSuccess("删除成功!");
+      });
   } else {
-    technologicalprocessDetailList.value = []
+    technologicalProcessList.value.splice(index, 1);
+    getTechnologicalProcesses(0);
   }
-  technologicalprocessDetailLoading.value = false
 }
 
-/** 搜索按钮操作 */
-function handleQuery() {
-  queryParams.value.pageNum = 1
-  getList()
+/** 工艺表批量删除操作
+ * 通过多选框选中方法,获得选中的工艺id,执行删除,山删除后,重新通过产品id获得工艺列表
+ */
+function TechnologicalProcessDelete() {
+  proxy.$modal
+    .confirm("是否确认删除选中的数据项?")
+    .then(function () {
+      return delTechnologicalProcess(technologicalProcessIds.value);
+    })
+    .then(() => {
+      getTechnologicalProcesses(0);
+      proxy.$modal.msgSuccess("删除成功!");
+    });
 }
 
+/***********************  标准工序  ****************************/
+// 获取工序列表
+const getTechnologicalProcessDetails = () => {
+  if (!currentTechnologicalProcess.value.id) {
+    technologicalprocessDetailList.value = [];
+  } else {
+    technologicalprocessDetailLoading.value = true;
+    listTechnologicalProcessDetail({
+      technologicalProcessId: currentTechnologicalProcess.value.id,
+    }).then((res) => {
+      technologicalprocessDetailList.value = res.rows;
+      technologicalprocessDetailLoading.value = false;
+    });
+  }
+};
+
 /** 点击工序编辑按钮 */
 function handleTechnologicalProcessDetailEdit() {
-  editStatus.value = true
+  editStatus.value = true;
 }
 
 /**点击工序取消编辑按钮 */
 function handleTechnologicalProcessCancel() {
-  editStatus.value = false
-  getTechnologicalProcessDetails()
-}
-/** 重置按钮操作 */
-function resetQuery() {
-  proxy.resetForm('queryRef')
-  handleQuery()
+  editStatus.value = false;
+  getTechnologicalProcessDetails();
 }
 
 /** 单条删除工序操作 */
 function handleDeleteTechnologicalProcessDetail(row, index) {
   if (!row.id) {
-    technologicalprocessDetailList.value.splice(index, 1)
+    technologicalprocessDetailList.value.splice(index, 1);
   } else {
     delTechnologicalProcessDetail(row.id).then((res) => {
       if (res.code == 200) {
-        getTechnologicalProcessDetails()
-        proxy.$modal.msgSuccess('删除成功')
+        getTechnologicalProcessDetails();
+        proxy.$modal.msgSuccess("删除成功");
       }
-    })
+    });
   }
 }
 
 /** 单条保存工序操作*/
 function handleSaveTechnologicalProcessDetail(row) {
   if (!row.processStepNumber) {
-    proxy.$modal.msgError('工序步骤编号不能为空')
+    proxy.$modal.msgError("工序步骤编号不能为空");
   } else {
     saveSingleTechnologicalProcessDetail(row).then((res) => {
       if (res.code == 200) {
-        getTechnologicalProcessDetails()
-        proxy.$modal.msgSuccess('保存成功')
-        row.editStatus = false
+        getTechnologicalProcessDetails();
+        proxy.$modal.msgSuccess("保存成功");
+        row.editStatus = false;
       }
-    })
+    });
   }
 }
-
-// 多选框选中数据
-function handleProductSelectionChange(selection) {
-  ids.value = selection.map((item) => item.id)
-  single.value = selection.length != 1
-  multiple.value = !selection.length
-}
 //工序多选框选中数据
 function processDetailSelectionChange(selection) {
-  technologicalProcessDetailIds.value = selection.map((item) => item.id)
-  single.value = selection.length != 1
+  technologicalProcessDetailIds.value = selection.map((item) => item.id);
+  single.value = selection.length != 1;
 }
 /** 获取行 id */
 function getRowKey(row) {
-  return row.id
+  return row.id;
 }
 /** 工序表多选带回保存
  * 将弹出框选中的内容保存到工序表
  */
 function handleProcessSelected(selection) {
   for (var i = 0; i < selection.length; i++) {
-    var technologicalProcessDetailAdd = {}
-    technologicalProcessDetailAdd.tenantId = currentProduct.value.tenantId
-    technologicalProcessDetailAdd.technologicalProcessId = currentTechnologicalProcess.value.id
-    technologicalProcessDetailAdd.productId = currentProduct.value.id
-    technologicalProcessDetailAdd.productCode = currentProduct.value.productCode
-    technologicalProcessDetailAdd.processId = selection[i].id
-    technologicalProcessDetailAdd.processAlias = selection[i].processAlias
-    technologicalProcessDetailAdd.processCode = selection[i].processCode
-    technologicalProcessDetailAdd.productShaftCategory = currentProduct.value.shaftCategoryCode
-    technologicalProcessDetailAdd.productShaftCategoryName = currentProduct.value.productShaftCategoryName
-    technologicalProcessDetailAdd.productDescription = currentProduct.value.remark
-    technologicalprocessDetailList.value.push(technologicalProcessDetailAdd)
-  }
-}
-/** 工艺表多选框选中数据 */
-function TechnologicalProcessSelectionChange(selection) {
-  technologicalProcessIds.value = selection.map((item) => item.id)
-  single.value = selection.length != 1
-}
-
-/** 新增按钮操作 */
-function handleAdd() {
-  proxy.$refs.productRef.open()
-}
-
-/** 修改按钮操作 */
-function handleUpdate(row) {
-  const id = row.id || ids.value
-  proxy.$refs.productRef.open(id)
-}
-
-/**
- * 工艺保存 事件
- * 添加工艺操作:添加后,执行刷新操作,重新查找工艺表内容,并通过绑定添加行的下标来选中,从而获得row
- */
-function handleSaveTechnologicalProcess(row, index) {
-  console.log(typeof row.technologyVersion)
-  if (!row.technologyVersion) {
-    proxy.$modal.msgError('工艺版本不能为空!')
-  } else {
-
-    if(row.technologyVersion !== "A" && row.technologyVersion !== "B" && row.technologyVersion !== "C") {
-    proxy.$modal.msgError('工艺版本只能填写A、B、C');
-}else {
-    row.productId = currentProduct.value.id
-    saveTechnologicalProcess(row).then((response) => {
-      if (response.code == 200) {
-        getTechnologicalProcesses(index)
-        proxy.$modal.msgSuccess('操作成功!')
-      }
-    })
-    row.editStatus = false
-  }
+    var technologicalProcessDetailAdd = {};
+    technologicalProcessDetailAdd.tenantId = currentProduct.value.tenantId;
+    technologicalProcessDetailAdd.technologicalProcessId =
+      currentTechnologicalProcess.value.id;
+    technologicalProcessDetailAdd.productId = currentProduct.value.id;
+    technologicalProcessDetailAdd.productCode =
+      currentProduct.value.productCode;
+    technologicalProcessDetailAdd.processId = selection[i].id;
+    technologicalProcessDetailAdd.processAlias = selection[i].processAlias;
+    technologicalProcessDetailAdd.processCode = selection[i].processCode;
+    technologicalProcessDetailAdd.productShaftCategory =
+      currentProduct.value.shaftCategoryCode;
+    technologicalProcessDetailAdd.productShaftCategoryName =
+      currentProduct.value.productShaftCategoryName;
+    technologicalProcessDetailAdd.productDescription =
+      currentProduct.value.remark;
+    technologicalprocessDetailList.value.push(technologicalProcessDetailAdd);
   }
 }
-
 /** 保存工序 */
 function handleTechnologicalProcessDetailAdd() {
   for (var i = 0; i < technologicalprocessDetailList.value.length; i++) {
     if (!technologicalprocessDetailList.value[i].processStepNumber) {
-      proxy.$modal.msgError('第' + (i + 1) + '行工序序号不能为空!')
-      return
+      proxy.$modal.msgError("第" + (i + 1) + "行工序序号不能为空!");
+      return;
     }
   }
-  saveTechnologicalProcessDetail(technologicalprocessDetailList.value).then((res) => {
-    if (res.code == 200) {
-      getTechnologicalProcessDetails()
-      proxy.$modal.msgSuccess('操作成功!')
+  saveTechnologicalProcessDetail(technologicalprocessDetailList.value).then(
+    (res) => {
+      if (res.code == 200) {
+        getTechnologicalProcessDetails();
+        proxy.$modal.msgSuccess("操作成功!");
+      }
     }
-  })
-  editStatus.value = false
-}
-
-/** 删除产品表操作 */
-function handleDelete(row) {
-  const _ids = row.id 
-  deleteIds.value.push(_ids)
-  proxy.$modal
-    .confirm('是否确认删除选中的数据项?')
-    .then(function () {
-      delProduct(deleteIds.value).then(() => {
-        getList()
-        proxy.$modal.msgSuccess('删除成功!')
-      })
-    })
-    .catch(() => {})
-}
-
-/** 单条删除工艺操作
- * 删除已经存在的数据-即row.id存在,执行一个对话框选择,如果确认则执行删除方法,并重新查询工艺表操作,
- * 让工艺表第一条默认选中
- * 删除未保存的苏剧-即row.id不存在,通过splice方法,通过下标删除数组的元素
- */
-function handleDeleteTechnologicalProcess(row, index) {
-  if (row.id) {
-    proxy.$modal
-      .confirm('是否确认删除选中的数据项?')
-      .then(function () {
-        return delTechnologicalProcess(row.id)
-      })
-      .then(() => {
-        getTechnologicalProcesses(0)
-        proxy.$modal.msgSuccess('删除成功!')
-      })
-  } else {
-    technologicalProcessList.value.splice(index, 1)
-    getTechnologicalProcesses(0)
-  }
-}
-
-/** 工艺表批量删除操作
- * 通过多选框选中方法,获得选中的工艺id,执行删除,山删除后,重新通过产品id获得工艺列表
- */
-function TechnologicalProcessDelete() {
-  proxy.$modal
-    .confirm('是否确认删除选中的数据项?')
-    .then(function () {
-      return delTechnologicalProcess(technologicalProcessIds.value)
-    })
-    .then(() => {
-      getTechnologicalProcesses(0)
-      proxy.$modal.msgSuccess('删除成功!')
-    })
+  );
+  editStatus.value = false;
 }
 /** 工序表批量删除操作
  * 通过多选框获得选中的工序id,执行删除操作后执行查询操作
  */
 function handledelTechnologicalProcessDetail() {
   proxy.$modal
-    .confirm('是否确认删除选中的数据项?')
+    .confirm("是否确认删除选中的数据项?")
     .then(function () {
-      return delTechnologicalProcessDetail(technologicalProcessDetailIds.value)
+      return delTechnologicalProcessDetail(technologicalProcessDetailIds.value);
     })
     .then(() => {
-      getTechnologicalProcessDetails()
-      proxy.$modal.msgSuccess('删除成功!')
-    })
+      getTechnologicalProcessDetails();
+      proxy.$modal.msgSuccess("删除成功!");
+    });
 }
 
 /** 添加工序 */
 function handleAddProcess() {
-  proxy.$refs.processChoiceRef.open()
-}
-/** 工艺添加操作 */
-const handleAddTechnologicalProcess = () => {
-  const newDetail = JSON.parse(JSON.stringify(detailsRow))
-  newDetail.editStatus = true
-  newDetail.productCode = currentProduct.value.productCode
-  newDetail.productId = currentProduct.value.id
-  newDetail.productShaftCategoryId = currentProduct.value.shaftCategoryId
-  newDetail.productDrawingNumber = currentProduct.value.drawingNumber
-  newDetail.productDescription = currentProduct.value.description
-  newDetail.productSpecification = currentProduct.value.specification
-  newDetail.tenantId = currentProduct.value.tenantId
-  newDetail.technologyVersion = ''
-  technologicalProcessList.value.push(newDetail)
-}
-/** 工艺添加取消操作 */
-const handleSync = () => {
-  productLoading.value = true
-  getP2Product(queryParams.value).then((res) => {
-    console.log(res)
-    getList()
-  })
+  proxy.$refs.processChoiceRef.open();
 }
+
 onMounted(() => {
-  getList()
-})
+  getList();
+});
 </script>

+ 50 - 53
src/views/business/productionBatch/DialogCheckMaterial.vue

@@ -18,15 +18,45 @@
         height="370px"
         header-row-class-name="list-header-row"
         row-class-name="list-row"
-      ><el-table-column type="index" label="行号" width="50" align="center" />
-       <el-table-column label="厂家" align="center" width="100px" prop="factory" />
-        <el-table-column label="炉号" align="center" width="100px" prop="furnaceNumber" />
-        <el-table-column label="牌号" align="center" width="100px" prop="brandNumber" />
+        ><el-table-column type="index" label="行号" width="50" align="center" />
+        <el-table-column
+          label="厂家"
+          align="center"
+          width="100px"
+          prop="factory"
+        />
+        <el-table-column
+          label="炉号"
+          align="center"
+          width="100px"
+          prop="furnaceNumber"
+        />
+        <el-table-column
+          label="牌号"
+          align="center"
+          width="100px"
+          prop="brandNumber"
+        />
         <el-table-column label="规格" align="center" width="70" prop="spec" />
-        <el-table-column label="材料直径" align="center" width="80" prop="diameter" />
+        <el-table-column
+          label="材料直径"
+          align="center"
+          width="80"
+          prop="diameter"
+        />
         <el-table-column label="形状" align="center" width="60" prop="shape" />
-        <el-table-column label="来料日期" align="center" width="100" prop="incomingDate" />
-        <el-table-column label="原料编码" align="center" width="90" prop="rawMaterialCode" />
+        <el-table-column
+          label="来料日期"
+          align="center"
+          width="100"
+          prop="incomingDate"
+        />
+        <el-table-column
+          label="原料编码"
+          align="center"
+          width="90"
+          prop="rawMaterialCode"
+        />
         <el-table-column
           label="技术要求1"
           align="center"
@@ -43,67 +73,34 @@
       <el-button type="primary" icon="Check" @click="submitForm"
         >确 定</el-button
       >
-      <!-- <el-button icon="Close" @click="cancel">取 消</el-button> -->
     </template>
   </el-dialog>
 </template>
 <script setup>
-import axios from "axios";
-import { getToken } from "@/utils/auth";
-import { getFurnaceNoInfo} from '@/api/business/furnaceNoInfo.js'
-
-const { proxy } = getCurrentInstance();
-/** 字典数组区 */
-/** 表单抽屉 页变量 */
+import { getFurnaceNoInfo } from "@/api/business/furnaceNoInfo.js";
+/** 领料信息变量 */
 const visible = ref(false);
 const loading = ref(false);
 const furnaceNoInfoList = ref([]);
-const data = reactive({
-  form: {},
-});
-const { form, rules } = toRefs(data);
 /***********************  方法区  ****************************/
 /** 打开抽屉 */
 function open(row) {
   loading.value = true;
-  furnaceNoInfoList.value = []
-  getFurnaceNoInfo({ productionPlanNo: row.productionPlanNo,
-      lineNumber: row.lineNumber}).then((res) => {
-        if (res.code === 200 && res.data.length>0) {
+  furnaceNoInfoList.value = [];
+  getFurnaceNoInfo({
+    productionPlanNo: row.productionPlanNo,
+    lineNumber: row.lineNumber,
+  }).then((res) => {
+    if (res.code === 200 && res.data.length > 0) {
       furnaceNoInfoList.value = res.data;
+    } else {
+      furnaceNoInfoList.value = [];
     }
-    else {
-      furnaceNoInfoList.value = []
-    }
-      })
-  // let token = "Bearer " + getToken();
-  // axios({
-  //   headers: {
-  //     Authorization: token,
-  //   },
-  //   method: "get",
-  //   url: "http://120.46.159.163:7002/business/furnaceNoInfo/getFurnaceNoInfo",
-  //   params: {
-  //     productionPlanNo: row.productionPlanNo,
-  //     lineNumber: row.lineNumber,
-  //   }
-  // }).then((res) => {
-  //   if (res.data.code === 200 && res.data.data.length>0) {
-  //     furnaceNoInfoList.value = res.data.data;
-  //   }
-  //   else {
-  //     furnaceNoInfoList.value = []
-  //   }
-  // });
-  loading.value = false
+  });
+  loading.value = false;
   visible.value = true;
 }
-/** 取消按钮 */
-function cancel() {
-  visible.value = false;
-}
-
-/** 提交按钮 */
+/** 确定按钮 */
 function submitForm() {
   visible.value = false;
 }

+ 210 - 124
src/views/business/productionBatch/form.vue

@@ -1,18 +1,44 @@
 <template>
   <!-- 添加或修改项目信息对话框 -->
-  <el-dialog title="投产" height="400px" v-model="visible" width="900px" append-to-body draggable>
+  <el-dialog
+    title="投产"
+    height="400px"
+    v-model="visible"
+    width="900px"
+    append-to-body
+    draggable
+  >
     <div class="form-container">
-      <el-form ref="productRef" class="master-container" :model="form" :rules="rules" label-width="120px">
+      <el-form
+        ref="productRef"
+        class="master-container"
+        :model="form"
+        :rules="rules"
+        label-width="120px"
+      >
         <el-row>
           <el-col :span="12">
             <el-form-item label="生产计划单号">
               <span>{{ detailsRow.productionPlanNo }}</span>
             </el-form-item>
             <el-form-item label="当前投产批数" prop="lotNumber">
-              <el-input-number v-model="form.lotNumber" controls-position="right" style="width: 150px" @input="handleUpdateLotNumber" :min="0" />
+              <el-input-number
+                v-model="form.lotNumber"
+                controls-position="right"
+                style="width: 150px"
+                @input="handleUpdateLotNumber"
+                :min="0"
+              />
             </el-form-item>
             <el-form-item label="下达日期" prop="issuanceDate">
-              <el-date-picker clearable v-model="form.issuanceDate" type="date" value-format="YYYY-MM-DD" placeholder="请选择实际开始 时间" style="width: 150px" />
+              <el-date-picker
+                clearable
+                v-model="form.issuanceDate"
+                type="date"
+                value-format="YYYY-MM-DD"
+                placeholder="请选择实际开始 时间"
+                style="width: 150px"
+              />
             </el-form-item>
           </el-col>
           <el-col :span="12">
@@ -20,140 +46,178 @@
               <span>{{ detailsRow.productDescription }}</span>
             </el-form-item>
             <el-form-item label="当前投产量" prop="productionQuantity">
-              <el-input-number v-model="form.productionQuantity" :precision="0" :disabled="true" controls-position="right" style="width: 150px" />
+              <el-input-number
+                v-model="form.productionQuantity"
+                :precision="0"
+                :disabled="true"
+                controls-position="right"
+                style="width: 150px"
+              />
             </el-form-item>
-            <el-form-item label="尾批" style="align-items: center;" prop="lastLotStatus">
-              <el-switch v-model="form.lastLotStatus" :disabled="detailsRow.lastLot || detailsRow.status" size="large" style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949" active-text="是" inactive-text="否" :active-value="1" :inactive-value="0" @change="handleUpdateLastLotStatus" />
+            <el-form-item
+              label="尾批"
+              style="align-items: center"
+              prop="lastLotStatus"
+            >
+              <el-switch
+                v-model="form.lastLotStatus"
+                :disabled="detailsRow.lastLot || detailsRow.status"
+                size="large"
+                style="
+                  --el-switch-on-color: #13ce66;
+                  --el-switch-off-color: #ff4949;
+                "
+                active-text="是"
+                inactive-text="否"
+                :active-value="1"
+                :inactive-value="0"
+                @change="handleUpdateLastLotStatus"
+              />
             </el-form-item>
           </el-col>
         </el-row>
       </el-form>
     </div>
     <template #footer>
-      <el-button type="primary" icon="Check" @click="handleSave">确定</el-button>
+      <el-button type="primary" icon="Check" @click="handleSave"
+        >确定</el-button
+      >
       <el-button icon="Close" @click="handleCancel">取 消</el-button>
     </template>
   </el-dialog>
 </template>
 <script setup>
-import { savePlanDetailSubDetail, getLastLotStatus } from '@/api/business/planDetailSubDetail.js'
-import { listPlanDetailSubDetail } from '@/api/business/planDetailSubDetail.js'
-import { updateLotCodeStatus } from '@/api/business/productionPlanDetail.js'
+import {
+  savePlanDetailSubDetail,
+  getLastLotStatus,
+} from "@/api/business/planDetailSubDetail.js";
+import { updateLotCodeStatus } from "@/api/business/productionPlanDetail.js";
 
-const { proxy } = getCurrentInstance()
-const emit = defineEmits(['handleSaveSuccess'])
+const { proxy } = getCurrentInstance();
+const emit = defineEmits(["handleSaveSuccess"]);
 
 /** 表单抽屉 页变量 */
-const loading = ref(false)
-const detailsRow = ref({})
-const visible = ref(false)
+const loading = ref(false);
+const detailsRow = ref({});
+const visible = ref(false);
+//校验投产批次
 const validateLotNumber = (rule, value, callback) => {
-  const min = 0
-  const max = detailsRow.value.lotNumber
+  const min = 0;
+  const max = detailsRow.value.lotNumber;
   //如果生产子计划里没有尾批并且是编辑状态时
-  if(!detailsRow.value.lastLot && detailsRow.value.status) {
-    const max = detailsRow.value.lotNumber - 1
-    if(value>max) {
-       callback(new Error(`尾批未投,当前投产批数不能超过` + max))
-    }else {
-    callback()
-  }
-  }
-  else {
-  if (!Number.isInteger(value)) {
-    callback(new Error(`当前投产批数不能是小数`))
-  } else if (value <= min) {
-    callback(new Error('当前投产批数应大于0'))
-  } else if (value > max) {
-    callback(new Error(`当前投产批数不能超过` + max))
+  if (!detailsRow.value.lastLot && detailsRow.value.status) {
+    const max = detailsRow.value.lotNumber - 1;
+    if (value > max) {
+      callback(new Error(`尾批未投,当前投产批数不能超过` + max));
+    } else {
+      callback();
+    }
   } else {
-    callback()
+    if (!Number.isInteger(value)) {
+      callback(new Error(`当前投产批数不能是小数`));
+    } else if (value <= min) {
+      callback(new Error("当前投产批数应大于0"));
+    } else if (value > max) {
+      callback(new Error(`当前投产批数不能超过` + max));
+    } else {
+      callback();
+    }
   }
-}
-}
+};
+//校验投产量
 const validateproductionQuantity = (rule, value, callback) => {
- //如果此批为尾批
+  //如果此批为尾批
   if (form.value.lastLotStatus == 1) {
-    var max = detailsRow.value.productionQuantity + detailsRow.value.lastLotQuantity
+    var max =
+      detailsRow.value.productionQuantity + detailsRow.value.lastLotQuantity;
   } else {
-    var max = detailsRow.value.productionQuantity
+    var max = detailsRow.value.productionQuantity;
   }
   if (value <= 0) {
-    callback(new Error('当前投产量应大于0'))
+    callback(new Error("当前投产量应大于0"));
   } else if (value > max) {
-    callback(new Error(`当前投产量不能超过` + max))
+    callback(new Error(`当前投产量不能超过` + max));
   } else {
-    callback()
+    callback();
   }
-}
+};
+//校验尾批switch
 const validateSwitch = (rule, value, callback) => {
   //detailsRow.value.status为true时为编辑,为false时是新增
   if (detailsRow.value.status) {
-    callback()
+    callback();
   } else {
     //当此批没选择尾批时
     if (form.value.lastLotStatus == 0) {
       //当前投产批数+子计划累计投产批数 = 总批数时,并且已投产的生产子计划没有尾批
-      if (form.value.lotNumber + detailsRow.value.lotTotalNumber == detailsRow.value.totalLotNumber && !detailsRow.value.lastLot) {
-        callback(new Error('此次投产应选尾批'))
+      if (
+        form.value.lotNumber + detailsRow.value.lotTotalNumber ==
+          detailsRow.value.totalLotNumber &&
+        !detailsRow.value.lastLot
+      ) {
+        callback(new Error("此次投产应选尾批"));
       } else {
-        callback()
-      }
-    }
-    else {
         callback();
       }
+    } else {
+      callback();
+    }
   }
-  }
+};
 const data = reactive({
   form: {
     deptId: null,
-    lotNumber: 0
-    },
+    lotNumber: 0,
+  },
   rules: {
     lotNumber: [
-      { required: true, message: '当前投产批数不能为空', trigger: 'blur' },
-      { validator: validateLotNumber, trigger: 'blur' }
+      { required: true, message: "当前投产批数不能为空", trigger: "blur" },
+      { validator: validateLotNumber, trigger: "blur" },
+    ],
+    issuanceDate: [
+      { required: true, message: "下达日期不能为空", trigger: "blur" },
     ],
-    issuanceDate: [{ required: true, message: '下达日期不能为空', trigger: 'blur' }],
     productionQuantity: [
-      { required: true, message: '当前投产量不能为空', trigger: 'blur' },
-      { validator: validateproductionQuantity, trigger: 'blur' }
+      { required: true, message: "当前投产量不能为空", trigger: "blur" },
+      { validator: validateproductionQuantity, trigger: "blur" },
     ],
     lastLotStatus: [
-      { required: false, message: '请选择是否尾批', trigger: ['change', 'blur'] },
-      { validator: validateSwitch, trigger: 'blur' } // 使用自定义验证函数进行验证
-    ]
-  }
-})
-const { form, rules } = toRefs(data)
+      {
+        required: false,
+        message: "请选择是否尾批",
+        trigger: ["change", "blur"],
+      },
+      { validator: validateSwitch, trigger: "blur" }, // 使用自定义验证函数进行验证
+    ],
+  },
+});
+const { form, rules } = toRefs(data);
 /***********************  方法区  ****************************/
 /** 表单重置 */
 function reset() {
   form.value = {
     id: null,
     productionPlanId: 0,
-    productionPlanDetailId: '0',
+    productionPlanDetailId: "0",
     productionQuantity: 0,
-    productId: '0',
-    technologicalProcessId: '0',
-    technologyVersion: '',
+    productId: "0",
+    technologicalProcessId: "0",
+    technologyVersion: "",
     lotNumber: 0,
     productionQuantity: 0,
-    issuanceDate: proxy.moment().format('YYYY-MM-DD'),
+    issuanceDate: proxy.moment().format("YYYY-MM-DD"),
     remark: null,
-    lastLotStatus:0
-  }
-  proxy.resetForm('productRef')
+    lastLotStatus: 0,
+  };
+  proxy.resetForm("productRef");
 }
 
 /** 打开抽屉 */
 function open(row) {
-  reset()
-  visible.value = true
-  loading.value = true
+  reset();
+  visible.value = true;
+  loading.value = true;
   if (row) {
-    console.log(row)
     detailsRow.value = proxy.deepClone(row);
     form.value.id = row.id;
     form.value.productionPlanNo = row.productionPlanNo;
@@ -162,100 +226,122 @@ function open(row) {
     form.value.deptId = row.deptId;
     form.value.technologicalProcessId = row.technologicalProcessId;
     form.value.technologyVersion = row.technologyVersion;
-    form.value.lastLotStatus =  detailsRow.value.lastLotStatus
-    console.log(form.value.lastLotStatus)
-    if (typeof row.pickUpQuantity == 'undefined') {
+    form.value.lastLotStatus = detailsRow.value.lastLotStatus;
+    if (typeof row.pickUpQuantity == "undefined") {
       detailsRow.value.pickUpQuantity = 0;
     }
-    if ( typeof row.lotTotalNumber == 'undefined') {
-      detailsRow.value.lotTotalNumber = 0
+    if (typeof row.lotTotalNumber == "undefined") {
+      detailsRow.value.lotTotalNumber = 0;
     }
     //当row.status为true时编辑状态
     if (row.status) {
-      form.value.lotNumber = row.lotNumber
-      detailsRow.value.lotNumber = detailsRow.value.totalLotNumber - detailsRow.value.lotTotalNumber + row.lotNumber
-      form.value.productionQuantity = row.productionQuantity
+      form.value.lotNumber = row.lotNumber;
+      detailsRow.value.lotNumber =
+        detailsRow.value.totalLotNumber -
+        detailsRow.value.lotTotalNumber +
+        row.lotNumber;
+      form.value.productionQuantity = row.productionQuantity;
       //已投产的生产子计划有尾批
       if (detailsRow.value.lastLot) {
-        detailsRow.value.productionQuantity = detailsRow.value.productionQuantityTotal - detailsRow.value.pickUpQuantity + detailsRow.value.productionQuantity    
+        detailsRow.value.productionQuantity =
+          detailsRow.value.productionQuantityTotal -
+          detailsRow.value.pickUpQuantity +
+          detailsRow.value.productionQuantity;
       } else {
-        detailsRow.value.productionQuantity = detailsRow.value.productionQuantityTotal - detailsRow.value.pickUpQuantity + detailsRow.value.productionQuantity - detailsRow.value.lastLotQuantity
+        detailsRow.value.productionQuantity =
+          detailsRow.value.productionQuantityTotal -
+          detailsRow.value.pickUpQuantity +
+          detailsRow.value.productionQuantity -
+          detailsRow.value.lastLotQuantity;
       }
       //新增状态
     } else {
-      detailsRow.value.lotNumber = detailsRow.value.totalLotNumber - detailsRow.value.lotTotalNumber;
-        //子计划已经有尾批
-        if(detailsRow.value.lastLot) {
+      detailsRow.value.lotNumber =
+        detailsRow.value.totalLotNumber - detailsRow.value.lotTotalNumber;
+      //子计划已经有尾批
+      if (detailsRow.value.lastLot) {
         detailsRow.value.productionQuantity =
-        detailsRow.value.productionQuantityTotal -
-        detailsRow.value.pickUpQuantity 
-        }
-        else {
+          detailsRow.value.productionQuantityTotal -
+          detailsRow.value.pickUpQuantity;
+      } else {
         detailsRow.value.productionQuantity =
-        detailsRow.value.productionQuantityTotal -
-        detailsRow.value.pickUpQuantity - detailsRow.value.lastLotQuantity;
-        }
+          detailsRow.value.productionQuantityTotal -
+          detailsRow.value.pickUpQuantity -
+          detailsRow.value.lastLotQuantity;
+      }
     }
   }
-  loading.value = false
+  loading.value = false;
 }
 //当前投产批数修改时,投产量自动改变
 function handleUpdateLotNumber(data) {
   if (data <= 0) {
-    form.value.productionQuantity = 0
+    form.value.productionQuantity = 0;
   } else {
     //该批为尾批
-    if(form.value.lastLotStatus == 1) {
-      if ((data-1) * detailsRow.value.oneLotQuantity >detailsRow.value.productionQuantity) {
-      form.value.productionQuantity = detailsRow.value.productionQuantity + detailsRow.value.lastLotQuantity;
-    } else {
-      form.value.productionQuantity = (data-1) * detailsRow.value.oneLotQuantity + detailsRow.value.lastLotQuantity ;
-    }   
+    if (form.value.lastLotStatus == 1) {
+      if (
+        (data - 1) * detailsRow.value.oneLotQuantity >
+        detailsRow.value.productionQuantity
+      ) {
+        form.value.productionQuantity =
+          detailsRow.value.productionQuantity +
+          detailsRow.value.lastLotQuantity;
+      } else {
+        form.value.productionQuantity =
+          (data - 1) * detailsRow.value.oneLotQuantity +
+          detailsRow.value.lastLotQuantity;
+      }
     }
     //该批不是尾批
-    else{
-       //当前投产批数*生产计划单批量>总投产量时,投产量为总投产量
-      if (data * detailsRow.value.oneLotQuantity >detailsRow.value.productionQuantity) {
-      form.value.productionQuantity = detailsRow.value.productionQuantity;
-    } else {
-        form.value.productionQuantity = data * detailsRow.value.oneLotQuantity
+    else {
+      //当前投产批数*生产计划单批量>总投产量时,投产量为总投产量
+      if (
+        data * detailsRow.value.oneLotQuantity >
+        detailsRow.value.productionQuantity
+      ) {
+        form.value.productionQuantity = detailsRow.value.productionQuantity;
+      } else {
+        form.value.productionQuantity = data * detailsRow.value.oneLotQuantity;
+      }
     }
   }
 }
-}
 //当尾批switch状态改变时
 function handleUpdateLastLotStatus() {
-  handleUpdateLotNumber(form.value.lotNumber)
+  handleUpdateLotNumber(form.value.lotNumber);
 }
 
 /** 提交按钮 */
 function handleSave() {
-  proxy.$refs['productRef'].validate((valid) => {
+  proxy.$refs["productRef"].validate((valid) => {
     if (valid) {
       // /**工艺版本变成P2拉取过来先绑定个假数据 */
       savePlanDetailSubDetail(form.value).then((res) => {
         if (res.code == 200) {
-          proxy.$modal.msgSuccess('保存成功!')
-          visible.value = false
+          proxy.$modal.msgSuccess("保存成功!");
+          visible.value = false;
           //detailsRow.value.id = detailsRow.value.productionPlanDetailId
           if (detailsRow.value.lotTotalNumber == 0) {
-            updateLotCodeStatus({ id: detailsRow.value.productionPlanDetailId, lotCodeStatusCode: 'OKK' }).then((res) => {})
+            updateLotCodeStatus({
+              id: detailsRow.value.productionPlanDetailId,
+              lotCodeStatusCode: "OKK",
+            }).then((res) => {});
           }
-          emit('handleSaveSuccess')
+          emit("handleSaveSuccess");
         }
-      })
-      console.log( form.value.lastLotStatus,form.value.lotNumber,detailsRow.value.lotTotalNumber,detailsRow.value.totalLotNumber,!detailsRow.value.lastLot)
+      });
     }
-  })
+  });
 }
 /** 取消按钮 */
 function handleCancel() {
-  visible.value = false
-  reset()
+  visible.value = false;
+  reset();
 }
 
 /** 暴露给父组件的方法 */
 defineExpose({
-  open
-})
+  open,
+});
 </script>

+ 401 - 240
src/views/business/productionBatch/index.vue

@@ -2,56 +2,198 @@
   <div class="page-container column-container">
     <section class="list-part-container column-container" style="flex: 1">
       <!-- 搜索区 -->
-      <el-form class="list-search-container" :model="queryParams" ref="queryRef" :inline="true">
+      <el-form
+        class="list-search-container"
+        :model="queryParams"
+        ref="queryRef"
+        :inline="true"
+      >
         <el-form-item class="section-title" label="生产计划" />
         <el-form-item label="生产计划单号:">
-          <el-input placeholder="请输入生产计划单号" v-model.trim="queryParams.productionPlanNo" @keyup.enter="handleQuery" @keydown.enter.prevent clearable style="width: 200px" />
+          <el-input
+            placeholder="请输入生产计划单号"
+            v-model.trim="queryParams.productionPlanNo"
+            @keyup.enter="handleQueryProductionPlanDetail"
+            @keydown.enter.prevent
+            clearable
+            style="width: 200px"
+          />
         </el-form-item>
         <el-form-item label="产品描述:">
-          <el-input placeholder="请输入产品描述" v-model.trim="queryParams.keywords" @keyup.enter="handleQuery" @keydown.enter.prevent clearable style="width: 200px" />
+          <el-input
+            placeholder="请输入产品描述"
+            v-model.trim="queryParams.keywords"
+            @keyup.enter="handleQueryProductionPlanDetail"
+            @keydown.enter.prevent
+            clearable
+            style="width: 200px"
+          />
         </el-form-item>
 
         <el-form-item>
-          <el-button type="info" icon="Search" @click="handleQuery"> 搜索 </el-button>
-          <!-- <el-button type="success" icon="Refresh" @click="handleQuery">刷新</el-button> -->
+          <el-button
+            type="info"
+            icon="Search"
+            @click="handleQueryProductionPlanDetail"
+          >
+            搜索
+          </el-button>
         </el-form-item>
-
         <el-form-item class="section-title" label="请选择当前工段:">
-          <el-select-v2 v-model="queryParams.deptId" filterable :options="deptList" placeholder="请选择工段" style="width: 100%" @change="handleDeptChange" />
+          <el-select-v2
+            v-model="queryParams.deptId"
+            filterable
+            :options="deptList"
+            placeholder="请选择工段"
+            style="width: 100%"
+            @change="handleDeptChange"
+          />
         </el-form-item>
-
       </el-form>
       <div class="el-table-container">
         <div class="el-table-inner-container">
-          <el-table ref="planDetailTable" :data="detailPlanList" v-loading="detailLoading" highlight-current-row height="100%" @current-change="handlePlanDetailCurrentChange">
-            <el-table-column label="客户简称" prop="companyAlias" width="150" align="center" />
-            <el-table-column label="生产计划单号" prop="productionPlanNo" width="110" align="center" />
-            <el-table-column label="序号" width="60" prop="lineNumber" align="center" />
-            <el-table-column label="产品描述" prop="productDescription" width="150" align="center" />
-            <el-table-column label="图纸版本" prop="technologyVersion" width="70" align="center" />
-            <el-table-column label="总投产量" prop="productionQuantity" width="80" align="center" />
-            <el-table-column label="总批数" prop="totalLotNumber" width="80" align="center" />
-            <el-table-column label="单批量" prop="oneLotQuantity" width="80" align="center" />
-            <el-table-column label="尾批量" prop="lastLotQuantity" width="80" align="center" />
-            <el-table-column label="批号状态" prop="lotCodeStatusCode" width="100" align="center">
+          <el-table
+            ref="planDetailTable"
+            :data="detailPlanList"
+            v-loading="detailLoading"
+            highlight-current-row
+            height="100%"
+            @current-change="handlePlanDetailCurrentChange"
+          >
+            <el-table-column
+              label="客户简称"
+              prop="companyAlias"
+              width="120"
+              align="center"
+            />
+            <el-table-column
+              label="生产计划单号"
+              prop="productionPlanNo"
+              width="110"
+              align="center"
+            />
+            <el-table-column
+              label="序号"
+              width="60"
+              prop="lineNumber"
+              align="center"
+            />
+            <el-table-column
+              label="产品描述"
+              prop="productDescription"
+              align="center"
+            />
+            <el-table-column
+              label="图纸版本"
+              prop="technologyVersion"
+              width="70"
+              align="center"
+            />
+            <el-table-column
+              label="总投产量"
+              prop="productionQuantity"
+              width="80"
+              align="center"
+            />
+            <el-table-column
+              label="总批数"
+              prop="totalLotNumber"
+              width="70"
+              align="center"
+            />
+            <el-table-column
+              label="单批量"
+              prop="oneLotQuantity"
+              width="80"
+              align="center"
+            />
+            <el-table-column
+              label="尾批量"
+              prop="lastLotQuantity"
+              width="80"
+              align="center"
+            />
+            <el-table-column
+              label="批号状态"
+              prop="lotCodeStatusCode"
+              width="100"
+              align="center"
+            >
               <template #default="scope">
-                <dict-tag :options="lot_code_status_code" :value="scope.row.lotCodeStatusCode" />
+                <dict-tag
+                  :options="lot_code_status_code"
+                  :value="scope.row.lotCodeStatusCode"
+                />
               </template>
             </el-table-column>
-            <!-- <el-table-column label="批号状态" prop="lotCodeStatusCode" width="60" align="center" /> -->
-            <el-table-column label="累计投产量" prop="pickUpQuantity" width="80" align="center" />
-            <el-table-column label="累计投产批数" prop="lotTotalNumber" width="90" align="center" />
-            <el-table-column label="库位" prop="storageLocation" width="80" align="center" />
-            <el-table-column label="领料部门" prop="requisitionDepartmentName" align="center" >
+            <el-table-column
+              label="累计投产量"
+              prop="pickUpQuantity"
+              width="80"
+              align="center"
+            />
+            <el-table-column
+              label="累计投产批数"
+              prop="lotTotalNumber"
+              width="90"
+              align="center"
+            />
+            <el-table-column
+              label="库位"
+              prop="storageLocation"
+              width="80"
+              align="center"
+            />
+            <el-table-column
+              label="领料部门"
+              prop="requisitionDepartmentName"
+              width="100"
+              align="center"
+            >
               <template #default="scope">
                 <span>{{ scope.row.requisitionDepartmentName }}</span>
               </template>
             </el-table-column>
-            <el-table-column label="下达日期" prop="issueDate" width="120" align="center" />
-            <el-table-column  label="操作" width="200" align="center" fixed="right">
+            <el-table-column
+              label="下达日期"
+              prop="issueDate"
+              width="100"
+              align="center"
+            />
+            <el-table-column
+              label="操作"
+              width="240"
+              align="center"
+              fixed="right"
+            >
               <template #default="scope">
-                <el-button  link type="warning" icon="View" @click="handleCheckMarterialInfo(scope.row)" >领料信息 </el-button>
-                <el-button :disabled="!(queryParams.deptId == scope.row.requisitionDepartmentId) ||(scope.row.totalLotNumber == scope.row.lotTotalNumber) " link type="primary" icon="Postcard" @click="handleAddSubDetail(scope.row)" v-hasPermi="['business:productionBatch:add']">投产 </el-button>
+                <el-button
+                  link
+                  type="success"
+                  icon="View"
+                  @click="handleCheckMarterialInfo(scope.row)"
+                  >领料信息
+                </el-button>
+                <el-button
+                  :disabled="
+                    !(
+                      queryParams.deptId == scope.row.requisitionDepartmentId
+                    ) || scope.row.totalLotNumber == scope.row.lotTotalNumber
+                  "
+                  link
+                  type="primary"
+                  icon="Postcard"
+                  @click="handleAddSubDetail(scope.row)"
+                  v-hasPermi="['business:productionBatch:add']"
+                  >投产
+                </el-button>
+                <!-- <el-button
+                  icon="edit"
+                  link
+                  type="warning"
+                  @click="handleUpdateProduction(scope.row)"
+                  >编辑</el-button
+                > -->
               </template>
             </el-table-column>
           </el-table>
@@ -59,7 +201,13 @@
       </div>
     </section>
     <!-- 分页 -->
-    <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getSubDetail" />
+    <pagination
+      v-show="total > 0"
+      :total="total"
+      v-model:page="queryParams.pageNum"
+      v-model:limit="queryParams.pageSize"
+      @pagination="getProductionPlanDetail"
+    />
 
     <section class="list-part-container row-container" style="flex: 1">
       <section class="list-part-container" style="flex: 4">
@@ -67,34 +215,101 @@
         <!-- 搜索区 -->
         <el-form class="list-search-container" :inline="true">
           <el-form-item class="section-title" label="生产子计划" />
-          <!-- <el-form-item class="section-title" label="请选择当前工段:">
-            <el-select-v2 v-model="queryParams.deptId" filterable :options="deptList" placeholder="请选择工段" style="width: 100%" @change="handleDeptChange" />
-          </el-form-item> -->
         </el-form>
         <div class="el-table-container">
           <div class="el-table-inner-container">
-            <el-table ref="subDetailsTable" v-loading="subDetailsLoading" :data="subList" highlight-current-row height="100%" @selection-change="handleSelectionChange" @current-change="handleSubDetailCurrentChange">
-              <el-table-column type="index" label="行号" width="50" align="center" />
-              <el-table-column label="生产计划单号" prop="productionPlanNo" width="110" align="center" />
-              <el-table-column label="产品描述" prop="productDescription" align="center" />
-              <el-table-column label="首序投产量" prop="productionQuantity" width="80" align="center" />
-              <el-table-column label="首序投产批数" prop="lotNumber" width="100" align="center">
+            <el-table
+              ref="subDetailsTable"
+              v-loading="subDetailsLoading"
+              :data="subList"
+              highlight-current-row
+              height="100%"
+            >
+              <el-table-column
+                type="index"
+                label="行号"
+                width="50"
+                align="center"
+              />
+              <el-table-column
+                label="生产计划单号"
+                prop="productionPlanNo"
+                width="110"
+                align="center"
+              />
+              <el-table-column
+                label="产品描述"
+                prop="productDescription"
+                align="center"
+              />
+              <el-table-column
+                label="首序投产量"
+                prop="productionQuantity"
+                width="80"
+                align="center"
+              />
+              <el-table-column
+                label="首序投产批数"
+                prop="lotNumber"
+                width="100"
+                align="center"
+              >
                 <template #default="scope">
-                  <el-input-number v-if="scope.row.editStatus" v-model="scope.row.lotNumber" placeholder="当前投产批数" :controls="false" :precision="0" :min="0" :max="scope.row.totalLotNumber" align="center" />
+                  <el-input-number
+                    v-if="scope.row.editStatus"
+                    v-model="scope.row.lotNumber"
+                    placeholder="当前投产批数"
+                    :controls="false"
+                    :precision="0"
+                    :min="0"
+                    :max="scope.row.totalLotNumber"
+                    align="center"
+                  />
                   <span v-else>{{ scope.row.lotNumber }}</span>
                 </template>
               </el-table-column>
-              <el-table-column label="下达日期" prop="issuanceDate" width="120" align="center">
+              <el-table-column
+                label="下达日期"
+                prop="issuanceDate"
+                width="120"
+                align="center"
+              >
                 <template #default="scope">
-                  <el-date-picker v-if="scope.row.editStatus" clearable v-model="scope.row.issuanceDate" type="date" value-format="YYYY-MM-DD" placeholder="请选择实际开始 时间" />
+                  <el-date-picker
+                    v-if="scope.row.editStatus"
+                    clearable
+                    v-model="scope.row.issuanceDate"
+                    type="date"
+                    value-format="YYYY-MM-DD"
+                    placeholder="请选择实际开始 时间"
+                  />
                   <span v-else>{{ scope.row.issuanceDate }}</span>
                 </template>
               </el-table-column>
-              <el-table-column label="操作" width="150" align="center" v-if="flag">
+              <el-table-column
+                label="操作"
+                width="150"
+                align="center"
+                v-if="flag"
+              >
                 <template #default="scope">
-                  <el-button v-if="!scope.row.editStatus" icon="edit" link type="warning" @click="handleShowSubDetailDialog(scope.row)" v-hasPermi="['business:productionBatch:edit']">编辑
+                  <el-button
+                    v-if="!scope.row.editStatus"
+                    icon="edit"
+                    link
+                    type="warning"
+                    @click="handleShowSubDetailDialog(scope.row)"
+                    v-hasPermi="['business:productionBatch:edit']"
+                    >编辑
                   </el-button>
-                  <el-button v-if="!scope.row.editStatus" icon="delete" link type="danger" @click="handleDelSubDetail(scope.row)" v-hasPermi="['business:productionBatch:remove']">删除
+                  <el-button
+                    v-if="!scope.row.editStatus"
+                    icon="delete"
+                    link
+                    type="danger"
+                    @click="handleDelSubDetail(scope.row)"
+                    v-hasPermi="['business:productionBatch:remove']"
+                    >删除
                   </el-button>
                 </template>
               </el-table-column>
@@ -103,294 +318,240 @@
         </div>
       </section>
     </section>
-    <!-- 表单 -->
-    <production-lot-form ref="productionRef" @handleSaveSuccess="handleFresh()" />
+    <!-- 投产表单 -->
+    <production-lot-form
+      ref="productionRef"
+      @handleSaveSuccess="handleFresh()"
+    />
+    <!-- 领料信息弹窗 -->
     <check-material ref="checkMaterialRef" />
+    <!-- <production-dialog ref="productionDetailRef" @handleUpdateSuccess = "handleFresh()"/> -->
   </div>
 </template>
 <script setup name="ProductionBatch">
-import { ref } from 'vue'
-import { listProductionPlanDetail } from '@/api/business/productionPlanDetail.js'
-import { savePlanDetailSubDetail, listPlanDetailSubDetail, delPlanDetailSubDetail, getDept, getLastLotStatus } from '@/api/business/planDetailSubDetail.js'
-import { saveBatchEquipment, listEquipment, delEquipment } from '@/api/business/productionPlanDetailEquipment.js'
-import { listTechnologicalProcessDetail } from '@/api/business/technologicalProcessDetail.js'
-import { updateLotCodeStatus } from '@/api/business/productionPlanDetail.js'
-import checkMaterial from './DialogCheckMaterial.vue'
-import productionLotForm from './form'
-const { proxy } = getCurrentInstance()
-const { lot_code_status_code } = proxy.useDict('lot_code_status_code')
-
-/** 生产子计划列表 */
-const subList = ref([])
-/** 工序列表 */
-const processList = ref([])
-/** 设备列表 */
-const equipmentList = ref([])
-/**当前工段列表 */
-const deptList = ref([])
-const planDetailTable = ref(null)
-const subDetailsTable = ref(null)
-const processTable = ref(null)
-
-/**生产计划批次点击对象 */
-const currentPlanDetail = ref({})
-const flag = ref(false)
-
-/**子计划点击对象 */
-const currentSubDetail = ref({})
-const currentProcess = ref({})
-
-const subDetailsLoading = ref(false)
-const equipmentLoading = ref(false)
-const detailPlanList = ref([])
-const loading = ref(false)
-const detailLoading = ref(false)
-const ids = ref([])
-const equipmentCodeIds = ref([])
-const single = ref(true)
-const multiple = ref(true)
-/**设备多选 */
-const equipmentIds = ref([])
-const equipmentSingle = ref(true)
-const equipmentMultiple = ref(true)
-const total = ref(0)
+import { ref } from "vue";
+import { listProductionPlanDetail } from "@/api/business/productionPlanDetail.js";
+import {
+  listPlanDetailSubDetail,
+  delPlanDetailSubDetail,
+  getDept,
+  getLastLotStatus
+} from "@/api/business/planDetailSubDetail.js";
+import { updateLotCodeStatus } from "@/api/business/productionPlanDetail.js";
+import checkMaterial from "./DialogCheckMaterial";
+import productionLotForm from "./form";
+// import productionDialog from './DialogProduction'
+const { proxy } = getCurrentInstance();
+/** 字典数组区 */
+const { lot_code_status_code } = proxy.useDict("lot_code_status_code");
+/** 生产计划 */
+const currentPlanDetail = ref({});
+const detailPlanList = ref([]);
+const detailLoading = ref(false);
+const total = ref(0);
+/** 工段 */
+const loading = ref(false);
+const deptList = ref([]);
+/** 生产子计划 */
+const subList = ref([]);
+const flag = ref(false);
+const subDetailsLoading = ref(false);
 /** 查询对象 */
 const queryParams = ref({
-  deptId: '',
-  keywords: '',
+  deptId: "",
+  keywords: "",
   pageNum: 1,
-  pageSize: 10
-})
+  pageSize: 10,
+});
 
 /***********************  方法区  ****************************/
-
+/***********************  工段  ****************************/
 /**
- * 查询生产批次列表
- * 由于生产计划批次列表是根据首序进行投产,所以不需要今天部门的获取
+查询工段
  *
  */
 function getList() {
-  loading.value = true
+  loading.value = true;
   getDept().then((response) => {
-    deptList.value = response.data
+    deptList.value = response.data;
     if (deptList.value.length > 0) {
-      queryParams.value.deptId = deptList.value[0].value
-      getSubDetail()
+      queryParams.value.deptId = deptList.value[0].value;
+      getProductionPlanDetail();
     }
-  })
-  loading.value = false
+  });
+  loading.value = false;
+}
+/**工段下拉框change事件 */
+function handleDeptChange() {
+  handlePlanDetailCurrentChange(currentPlanDetail.value);
 }
+/***********************  生产计划  ****************************/
 
 /** 生产子计划进行修改时,对生产计划进行重新查询并选中*/
 function handleFresh() {
-  detailLoading.value = true
+  detailLoading.value = true;
   listProductionPlanDetail(queryParams.value).then((res) => {
-    detailPlanList.value = res.rows
-    total.value = res.total
-    detailLoading.value = false
+    detailPlanList.value = res.rows;
+    total.value = res.total;
+    detailLoading.value = false;
     //生产子计划点击
     if (detailPlanList.value.length > 0) {
       for (var i = 0; i < detailPlanList.value.length; i++) {
         if (detailPlanList.value[i].id == currentPlanDetail.value.id) {
-          var index = i
-          break
+          var index = i;
+          break;
         }
       }
     }
-    proxy.$refs.planDetailTable.setCurrentRow(detailPlanList.value[index])
-  })
+    proxy.$refs.planDetailTable.setCurrentRow(detailPlanList.value[index]);
+  });
 }
-
 /**查询计划明细 */
-function getSubDetail() {
-  detailLoading.value = true
+function getProductionPlanDetail() {
+  detailLoading.value = true;
   listProductionPlanDetail(queryParams.value).then((res) => {
-    detailPlanList.value = res.rows
-    total.value = res.total
-    detailLoading.value = false
-    detailPlanList.value = res.rows
-    total.value = res.total
-    detailLoading.value = false
+    detailPlanList.value = res.rows;
+    total.value = res.total;
+    detailLoading.value = false;
+    detailPlanList.value = res.rows;
+    total.value = res.total;
+    detailLoading.value = false;
     //生产子计划点击
     if (detailPlanList.value.length > 0) {
-      proxy.$refs.planDetailTable.setCurrentRow(detailPlanList.value[0])
+      proxy.$refs.planDetailTable.setCurrentRow(detailPlanList.value[0]);
     }
-  })
-}
-/** 搜索按钮操作 */
-function handleQuery() {
-  queryParams.value.pageNum = 1
-  getSubDetail()
-}
-
-// 多选框选中子计划数据
-function handleSelectionChange(selection) {
-  ids.value = selection.map((item) => item.id)
-  single.value = selection.length != 1
-  multiple.value = !selection.length
+  });
 }
-// 多选框选中设备数据
-function handleEquipmentSelectionChange(selection) {
-  equipmentIds.value = selection.map((item) => item.id)
-  equipmentSingle.value = selection.length != 1
-  equipmentMultiple.value = !selection.length
+/** 生产计划搜索按钮操作 */
+function handleQueryProductionPlanDetail() {
+  queryParams.value.pageNum = 1;
+  getProductionPlanDetail();
 }
+// //修改生产计划
+// function handleUpdateProduction(row) {
+//   proxy.$refs.productionDetailRef.open(row);
+// }
 //查询生产计划单的领料信息
 function handleCheckMarterialInfo(row) {
-  proxy.$refs.checkMaterialRef.open(row)
+  proxy.$refs.checkMaterialRef.open(row);
 }
 /** 生产计划明细 current-change 事件 */
 function handlePlanDetailCurrentChange(row) {
   if (row) {
-    currentPlanDetail.value = row
-    if(currentPlanDetail.value.requisitionDepartmentId == queryParams.value.deptId) {
-      flag.value = true
+    currentPlanDetail.value = row;
+    if (
+      currentPlanDetail.value.requisitionDepartmentId ==
+      queryParams.value.deptId
+    ) {
+      flag.value = true;
+    } else {
+      flag.value = false;
     }
-    else {
-      flag.value = false
-    }
-    subDetailsLoading.value = true
+    subDetailsLoading.value = true;
     listPlanDetailSubDetail({
       productionPlanDetailId: row.id,
-      deptId: queryParams.value.deptId
+      deptId: queryParams.value.deptId,
     }).then((res) => {
-      subList.value = res.rows
-      subDetailsLoading.value = false
-      if (subList.value.length > 0) {
-        proxy.$refs.subDetailsTable.setCurrentRow(subList.value[0])
-      }
-    })
+      subList.value = res.rows;
+      subDetailsLoading.value = false;
+    });
   } else {
-    subList.value = []
-    processList.value = []
-    equipmentList.value = []
+    subList.value = [];
   }
 }
-/** 生产子计划 current-change 事件 */
-function handleSubDetailCurrentChange(row) {
-  if (row) {
-    currentSubDetail.value = row
-    listTechnologicalProcessDetail({
-      technologicalProcessId: row.technologicalProcessId
-    }).then((res) => {
-      processList.value = res.rows
-    })
-  }
-}
-/**工段下拉框change事件 */
-function handleDeptChange() {
-  handlePlanDetailCurrentChange(currentPlanDetail.value)
-}
-
+/***********************  生产子计划  ****************************/
 /**新增按钮生产子计划 */
 function handleAddSubDetail(row) {
   /**创建一个空的对象,将生产计划中的数据赋值给子计划数据 */
-  const newDetail = {}
-  newDetail.productionPlanId = row.productionPlanId
-  newDetail.productionPlanDetailId = row.id
-  newDetail.productionPlanNo = row.productionPlanNo
+  const newDetail = {};
+  newDetail.productionPlanId = row.productionPlanId;
+  newDetail.productionPlanDetailId = row.id;
+  newDetail.productionPlanNo = row.productionPlanNo;
   //生产计划总投产量
-  newDetail.productionQuantityTotal = row.productionQuantity
-  newDetail.productId = row.productId
-  newDetail.productDescription = row.productDescription
-   //生产计划单批量
-  newDetail.oneLotQuantity = row.oneLotQuantity
-  newDetail.deptId = queryParams.value.deptId
-  newDetail.totalLotNumber = row.totalLotNumber
-  newDetail.technologicalProcessId = row.technologicalProcessId
-  newDetail.technologyVersion = row.technologyVersion
+  newDetail.productionQuantityTotal = row.productionQuantity;
+  newDetail.productId = row.productId;
+  newDetail.productDescription = row.productDescription;
+  //生产计划单批量
+  newDetail.oneLotQuantity = row.oneLotQuantity;
+  newDetail.deptId = queryParams.value.deptId;
+  newDetail.totalLotNumber = row.totalLotNumber;
+  newDetail.technologicalProcessId = row.technologicalProcessId;
+  newDetail.technologyVersion = row.technologyVersion;
   //子计划累计投产量
-  newDetail.pickUpQuantity = row.pickUpQuantity
-   //子计划累计投产批数
-  newDetail.lotTotalNumber = row.lotTotalNumber
-   //生产计划尾批数
-  newDetail.lastLotQuantity = row.lastLotQuantity
+  newDetail.pickUpQuantity = row.pickUpQuantity;
+  //子计划累计投产批数
+  newDetail.lotTotalNumber = row.lotTotalNumber;
+  //生产计划尾批数
+  newDetail.lastLotQuantity = row.lastLotQuantity;
   //新增尾批状态默认为否
-  newDetail.lastLotStatus = 0
+  newDetail.lastLotStatus = 0;
   //新增状态
-  newDetail.status = false
+  newDetail.status = false;
   //新增时查询生产子计划数据
   getLastLotStatus(row.id).then((response) => {
     if (response.code == 200) {
       //如果为true,生产子计划已有尾批
-      newDetail.lastLot = response.data
-      proxy.$refs.productionRef.open(newDetail)
+      newDetail.lastLot = response.data;
+      proxy.$refs.productionRef.open(newDetail);
     }
-  })
+  });
 }
 
 /** 修改 生产子计划 事件 */
 function handleShowSubDetailDialog(row) {
-  console.log(row)
   //生产计划单批量
-  row.oneLotQuantity = currentPlanDetail.value.oneLotQuantity
+  row.oneLotQuantity = currentPlanDetail.value.oneLotQuantity;
   //子计划累计投产量
-  row.pickUpQuantity = currentPlanDetail.value.pickUpQuantity
+  row.pickUpQuantity = currentPlanDetail.value.pickUpQuantity;
   //子计划累计投产批数
-  row.lotTotalNumber = currentPlanDetail.value.lotTotalNumber
+  row.lotTotalNumber = currentPlanDetail.value.lotTotalNumber;
   //生产计划总投产量
-  row.productionQuantityTotal = currentPlanDetail.value.productionQuantity
+  row.productionQuantityTotal = currentPlanDetail.value.productionQuantity;
   //生产计划总批数
-  row.totalLotNumber = currentPlanDetail.value.totalLotNumber
+  row.totalLotNumber = currentPlanDetail.value.totalLotNumber;
   //生产计划尾批数
-  row.lastLotQuantity = currentPlanDetail.value.lastLotQuantity
+  row.lastLotQuantity = currentPlanDetail.value.lastLotQuantity;
   //生产计划id
-  row.productionPlanDetailId = currentPlanDetail.value.id
+  row.productionPlanDetailId = currentPlanDetail.value.id;
   //编辑状态
-  row.status = true
+  row.status = true;
   //修改尾批状态在row里
   getLastLotStatus(currentPlanDetail.value.id).then((response) => {
     if (response.code == 200) {
       //如果为true,生产子计划已有尾批
-      newDetail.lastLot = response.data
-      proxy.$refs.productionRef.open(newDetail)
-    }
-  })
-  row.lastLot = false
-  proxy.$refs.productionRef.open(row)
-}
-
-/** 生产子计划 保存事件 */
-function handleSaveSubDetail(row) {
-  savePlanDetailSubDetail(row).then((res) => {
-    if (res.code == 200) {
-      proxy.$modal.msgSuccess('保存成功!')
-      getSubDetail()
-      //handlePlanDetailCurrentChange(currentPlanDetail.value)
+      newDetail.lastLot = response.data;
+      proxy.$refs.productionRef.open(newDetail);
     }
-  })
+  });
+  row.lastLot = false;
+  proxy.$refs.productionRef.open(row);
 }
 
 /** 删除子计划事件 */
 function handleDelSubDetail(row) {
-  const _ids = row.id || ids.value
-  var subInfo = subList.value.filter((item) => !item.id.includes(_ids))
+  const _ids = row.id;
+  var subInfo = subList.value.filter((item) => !item.id.includes(_ids));
   proxy.$modal
-    .confirm('是否确认删除选中的数据项?')
+    .confirm("是否确认删除选中的数据项?")
     .then(function () {
-      return delPlanDetailSubDetail(_ids)
+      return delPlanDetailSubDetail(_ids);
     })
     .then(() => {
       if (subInfo.length == 0) {
         updateLotCodeStatus({
           id: currentPlanDetail.value.id,
-          lotCodeStatusCode: 'NA'
-        }).then((res) => {})
+          lotCodeStatusCode: "NA",
+        }).then((res) => {});
       }
-      handleFresh()
-      //handlePlanDetailCurrentChange(currentPlanDetail.value)
-
-      proxy.$modal.msgSuccess('删除成功!')
+      handleFresh();
+      proxy.$modal.msgSuccess("删除成功!");
     })
-    .catch(() => {})
+    .catch(() => {});
 }
-
-/** */
-
 onMounted(() => {
-  getSubDetail()
-  getList()
-})
+  getProductionPlanDetail();
+  getList();
+});
 </script>
 <style scoped>
 .list-search-container-child .el-form-item {