|
@@ -6,34 +6,43 @@
|
|
|
<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-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="handleQueryProduct" @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="handleQueryProduct" @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="handleQueryProduct" @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="handleQueryProduct" @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="handleQueryProduct" @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="handleQueryProduct">搜索</el-button>
|
|
|
- <el-button v-show="false" 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-button v-show="false" 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 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" />
|
|
@@ -73,8 +82,10 @@
|
|
|
<el-table-column label="技术员编码" align="center" prop="technicianCode" />
|
|
|
<el-table-column fixed="right" label="操作" align="center" width="140px">
|
|
|
<template #default="scope">
|
|
|
- <el-button v-show="false" link type="warning" icon="Edit" @click="handleUpdateProduct(scope.row)" v-hasPermi="['business:product:edit']">编辑</el-button>
|
|
|
- <el-button v-show="false" link type="danger" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['business:product:remove']">删除</el-button>
|
|
|
+ <el-button v-show="false" link type="warning" icon="Edit" @click="handleUpdateProduct(scope.row)"
|
|
|
+ v-hasPermi="['business:product:edit']">编辑</el-button>
|
|
|
+ <el-button v-show="false" link type="danger" icon="Delete" @click="handleDelete(scope.row)"
|
|
|
+ v-hasPermi="['business:product:remove']">删除</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -85,10 +96,11 @@
|
|
|
<div class="drawing-info" style="margin-left: 20px;">
|
|
|
工艺图纸电子化率:<span style="color: blue;font-size: 22px;">{{ drawingRatio }}%</span>
|
|
|
</div> -->
|
|
|
- <!-- 分页 -->
|
|
|
- <!-- <div class="pagination-container"> -->
|
|
|
- <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
|
|
- <!-- </div>
|
|
|
+ <!-- 分页 -->
|
|
|
+ <!-- <div class="pagination-container"> -->
|
|
|
+ <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
|
|
|
+ v-model:limit="queryParams.pageSize" @pagination="getList" />
|
|
|
+ <!-- </div>
|
|
|
</div> -->
|
|
|
|
|
|
<section class="list-part-container row-container" style="flex: 1">
|
|
@@ -97,24 +109,20 @@
|
|
|
<el-form class="list-search-container" :model="queryParams" ref="queryRef" :inline="true">
|
|
|
<el-form-item class="section-title" label="标准工艺" />
|
|
|
<el-form-item>
|
|
|
- <el-button v-show="false" type="primary" icon="Plus" @click="handleAddTechnologicalProcess" v-hasPermi="['business:product:add']" :disabled="!currentProduct.id"> 添加工艺 </el-button>
|
|
|
- <el-button v-show="false" type="danger" icon="Delete" @click="TechnologicalProcessDelete" :disabled="technologicalProcessIds.length === 0" v-hasPermi="['business:product:remove']"> 删除工艺 </el-button>
|
|
|
+ <el-button v-show="false" type="primary" icon="Plus" @click="handleAddTechnologicalProcess"
|
|
|
+ v-hasPermi="['business:product:add']" :disabled="!currentProduct.id"> 添加工艺 </el-button>
|
|
|
+ <el-button v-show="false" 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"
|
|
|
+ <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"
|
|
|
- >
|
|
|
+ @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">
|
|
@@ -127,10 +135,15 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column label="操作" width="140px" align="center">
|
|
|
<template #default="scope">
|
|
|
- <el-button v-show="false" v-if="scope.row.editStatus" link type="primary" icon="Check" @click="handleSaveTechnologicalProcess(scope.row, scope.$index)" v-hasPermi="['business:product:add']"> 保存 </el-button>
|
|
|
+ <el-button v-show="false" v-if="scope.row.editStatus" link type="primary" icon="Check"
|
|
|
+ @click="handleSaveTechnologicalProcess(scope.row, scope.$index)"
|
|
|
+ v-hasPermi="['business:product:add']"> 保存 </el-button>
|
|
|
|
|
|
- <el-button v-show="false" v-else link type="warning" icon="Edit" @click.prevent="scope.row.editStatus = true" v-hasPermi="['business:product:edit']"> 编辑 </el-button>
|
|
|
- <el-button v-show="false" link type="danger" icon="Delete" @click="handleDeleteTechnologicalProcess(scope.row, scope.$index)" v-hasPermi="['business:product:remove']"> 删除 </el-button>
|
|
|
+ <el-button v-show="false" v-else link type="warning" icon="Edit"
|
|
|
+ @click.prevent="scope.row.editStatus = true" v-hasPermi="['business:product:edit']"> 编辑 </el-button>
|
|
|
+ <el-button v-show="false" link type="danger" icon="Delete"
|
|
|
+ @click="handleDeleteTechnologicalProcess(scope.row, scope.$index)"
|
|
|
+ v-hasPermi="['business:product:remove']"> 删除 </el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -138,21 +151,31 @@
|
|
|
</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-show="false" v-if="!editStatus" @click="handleTechnologicalProcessDetailEdit" :disabled="technologicalProcessList.length === 0 || currentTechnologicalProcess.id == null" v-hasPermi="['business:product:edit']" type="warning" icon="Edit"> 编辑 </el-button>
|
|
|
+ <el-button v-show="false" v-if="!editStatus" @click="handleTechnologicalProcessDetailEdit"
|
|
|
+ :disabled="technologicalProcessList.length === 0 || currentTechnologicalProcess.id == null"
|
|
|
+ v-hasPermi="['business:product:edit']" type="warning" icon="Edit"> 编辑 </el-button>
|
|
|
<template v-if="editStatus">
|
|
|
- <el-button v-show="false" type="primary" icon="Plus" @click="handleAddProcess" v-hasPermi="['business:product:add']" :disabled="!currentTechnologicalProcess.id"> 添加工序 </el-button>
|
|
|
- <el-button v-show="false" type="danger" @click="handleTechnologicalProcessCancel" v-hasPermi="['business:product:edit']" icon="Close">取消编辑</el-button>
|
|
|
+ <el-button v-show="false" type="primary" icon="Plus" @click="handleAddProcess"
|
|
|
+ v-hasPermi="['business:product:add']" :disabled="!currentTechnologicalProcess.id"> 添加工序 </el-button>
|
|
|
+ <el-button v-show="false" type="danger" @click="handleTechnologicalProcessCancel"
|
|
|
+ v-hasPermi="['business:product:edit']" icon="Close">取消编辑</el-button>
|
|
|
</template>
|
|
|
- <el-button v-show="false" type="success" v-if="editStatus" icon="Check" :disabled="technologicalprocessDetailList.length === 0" v-hasPermi="['business:product:add']" @click="handleTechnologicalProcessDetailAdd">保存</el-button>
|
|
|
- <el-button v-show="false" type="danger" icon="Delete" v-if="!editStatus" @click="handledelTechnologicalProcessDetail" :disabled="technologicalProcessDetailIds.length === 0" v-hasPermi="['business:product:remove']"> 删除工序 </el-button>
|
|
|
+ <el-button v-show="false" type="success" v-if="editStatus" icon="Check"
|
|
|
+ :disabled="technologicalprocessDetailList.length === 0" v-hasPermi="['business:product:add']"
|
|
|
+ @click="handleTechnologicalProcessDetailAdd">保存</el-button>
|
|
|
+ <el-button v-show="false" 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">
|
|
@@ -167,10 +190,17 @@
|
|
|
<el-table-column label="工序简称" align="center" prop="processAlias" />
|
|
|
<el-table-column v-if="!editStatus" label="操作" width="140px" align="center">
|
|
|
<template #default="scope">
|
|
|
- <el-button link type="primary" @click="handleShowResourceGroupDetailForm(scope.row)" v-hasPermi="['business:drawing:list']"> 图纸 </el-button>
|
|
|
- <el-button v-show="false" 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-show="false" 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 v-show="false" link type="danger" icon="Delete" @click="handleDeleteTechnologicalProcessDetail(scope.row, scope.$index)" v-hasPermi="['business:product:remove']"> 删除 </el-button>
|
|
|
+ <el-button link type="primary" @click="handleShowResourceGroupDetailForm(scope.row)"
|
|
|
+ v-hasPermi="['business:drawing:list']"> 图纸 </el-button>
|
|
|
+ <el-button v-show="false" 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-show="false" 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 v-show="false" link type="danger" icon="Delete"
|
|
|
+ @click="handleDeleteTechnologicalProcessDetail(scope.row, scope.$index)"
|
|
|
+ v-hasPermi="['business:product:remove']"> 删除 </el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -183,12 +213,12 @@
|
|
|
<!-- 工序弹窗 -->
|
|
|
<process-choice ref="processChoiceRef" :multiple-selected="handleProcessSelected"></process-choice>
|
|
|
<!-- 图纸弹窗 -->
|
|
|
- <drawing ref="drawingForm" @handleSaveResourceSuccess="handleRefreshEquipment"/>
|
|
|
+ <drawing ref="drawingForm" @handleSaveResourceSuccess="handleRefreshEquipment" />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import { listProduct, delProduct,getProductTotal } from '@/api/business/product'
|
|
|
+import { listProduct, delProduct, getProductTotal } from '@/api/business/product'
|
|
|
import { getP2Product } from '@/api/business/p2.js'
|
|
|
import productForm from './form'
|
|
|
import processChoice from './DialogProcessChoice'
|
|
@@ -251,7 +281,7 @@ const queryParams = ref({
|
|
|
*/
|
|
|
function getList() {
|
|
|
productLoading.value = true
|
|
|
-
|
|
|
+
|
|
|
listProduct(queryParams.value).then((response) => {
|
|
|
productList.value = response.rows
|
|
|
total.value = response.total
|
|
@@ -263,16 +293,16 @@ function getList() {
|
|
|
technologicalprocessDetailList.value = []
|
|
|
}
|
|
|
//0712查询当前产品的图纸数量
|
|
|
- getProcuctDrawing().then(res=>{
|
|
|
- console.log(res,4446)
|
|
|
- productDrawing.value = res.data
|
|
|
- getProductTotal().then(response=>{
|
|
|
- console.log(response.data)
|
|
|
- productTotal.value = response.data
|
|
|
- drawingRatio.value = (productDrawing.value / productTotal.value *100).toFixed(2)
|
|
|
+ getProcuctDrawing().then(res => {
|
|
|
+ console.log(res, 4446)
|
|
|
+ productDrawing.value = res.data
|
|
|
+ getProductTotal().then(response => {
|
|
|
+ console.log(response.data)
|
|
|
+ productTotal.value = response.data
|
|
|
+ drawingRatio.value = (productDrawing.value / productTotal.value * 100).toFixed(2)
|
|
|
+ })
|
|
|
+
|
|
|
})
|
|
|
-
|
|
|
- })
|
|
|
})
|
|
|
}
|
|
|
/**
|
|
@@ -312,14 +342,14 @@ function handleDelete(row) {
|
|
|
proxy.$modal.msgSuccess('删除成功!')
|
|
|
})
|
|
|
})
|
|
|
- .catch(() => {})
|
|
|
+ .catch(() => { })
|
|
|
}
|
|
|
|
|
|
/*********************** 标准工艺 ****************************/
|
|
|
// 获取工艺列表
|
|
|
const getTechnologicalProcesses = (index) => {
|
|
|
technologicalProcessLoading.value = true
|
|
|
- listTechnologicalProcess({ productId: currentProduct.value.id }).then((res) => {
|
|
|
+ listTechnologicalProcess({ productId: currentProduct.value.id, isHistory: 0 }).then((res) => {
|
|
|
technologicalProcessList.value = res.rows
|
|
|
technologicalProcessLoading.value = false
|
|
|
if (technologicalProcessList.value.length > 0) {
|
|
@@ -557,11 +587,11 @@ function handleAddProcess() {
|
|
|
*/
|
|
|
function handleShowResourceGroupDetailForm(row) {
|
|
|
console.log(row)
|
|
|
- proxy.$refs.drawingForm.open(row);
|
|
|
-
|
|
|
+ proxy.$refs.drawingForm.open(row);
|
|
|
+
|
|
|
}
|
|
|
|
|
|
-function handleRefreshEquipment(){
|
|
|
+function handleRefreshEquipment() {
|
|
|
|
|
|
}
|
|
|
|
|
@@ -571,22 +601,25 @@ onMounted(() => {
|
|
|
</script>
|
|
|
<style scoped>
|
|
|
.relative-container {
|
|
|
- position: relative;
|
|
|
- display: flex;
|
|
|
- justify-content: space-between; /* 使文本和分页组件分别靠近容器的两端 */
|
|
|
- align-items: center;
|
|
|
-
|
|
|
+ position: relative;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ /* 使文本和分页组件分别靠近容器的两端 */
|
|
|
+ align-items: center;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
.drawing-info {
|
|
|
- /* 根据需要添加样式,例如字体大小、颜色等 */
|
|
|
- flex-shrink: 0; /* 防止文本压缩 */
|
|
|
+ /* 根据需要添加样式,例如字体大小、颜色等 */
|
|
|
+ flex-shrink: 0;
|
|
|
+ /* 防止文本压缩 */
|
|
|
}
|
|
|
|
|
|
.pagination-container {
|
|
|
- /* flex-grow: 1; 让分页容器占据剩余空间 */
|
|
|
- text-align: center; /* 确保分页组件内的文本居中显示 */
|
|
|
- margin-bottom: 5px;
|
|
|
- margin-right: 8px;
|
|
|
+ /* flex-grow: 1; 让分页容器占据剩余空间 */
|
|
|
+ text-align: center;
|
|
|
+ /* 确保分页组件内的文本居中显示 */
|
|
|
+ margin-bottom: 5px;
|
|
|
+ margin-right: 8px;
|
|
|
}
|
|
|
</style>
|