|
@@ -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>
|