|
|
|
|
@ -26,31 +26,21 @@
|
|
|
|
|
class="!w-240px"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="规格" prop="moldType">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="queryParams.moldType"
|
|
|
|
|
placeholder="请输入规格"
|
|
|
|
|
clearable
|
|
|
|
|
@keyup.enter="handleQuery"
|
|
|
|
|
class="!w-240px"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="产品" prop="productId">
|
|
|
|
|
<el-form-item label="工序" prop="orgType">
|
|
|
|
|
<el-select
|
|
|
|
|
v-model="queryParams.productId"
|
|
|
|
|
v-model="queryParams.orgType"
|
|
|
|
|
placeholder="请选择工序"
|
|
|
|
|
clearable
|
|
|
|
|
filterable
|
|
|
|
|
placeholder="请选择产品"
|
|
|
|
|
class="!w-240px"
|
|
|
|
|
>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in productList"
|
|
|
|
|
:key="item.id"
|
|
|
|
|
:label="item.name"
|
|
|
|
|
:value="item.id"
|
|
|
|
|
v-for="dict in orgTypeOptions"
|
|
|
|
|
:key="dict.value"
|
|
|
|
|
:label="dict.label"
|
|
|
|
|
:value="dict.value"
|
|
|
|
|
/>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<!-- <el-form-item label="维保模式" prop="maintainType">
|
|
|
|
|
<el-select
|
|
|
|
|
v-model="queryParams.maintainType"
|
|
|
|
|
@ -66,15 +56,6 @@
|
|
|
|
|
/>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item> -->
|
|
|
|
|
<el-form-item label="备注" prop="remark">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="queryParams.remark"
|
|
|
|
|
placeholder="请输入备注"
|
|
|
|
|
clearable
|
|
|
|
|
@keyup.enter="handleQuery"
|
|
|
|
|
class="!w-240px"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
<el-form-item>
|
|
|
|
|
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
|
|
|
|
|
@ -103,13 +84,17 @@
|
|
|
|
|
<!-- 列表 -->
|
|
|
|
|
<ContentWrap>
|
|
|
|
|
<el-table
|
|
|
|
|
ref="tableRef"
|
|
|
|
|
v-loading="loading"
|
|
|
|
|
:data="list"
|
|
|
|
|
:stripe="true"
|
|
|
|
|
:show-overflow-tooltip="true"
|
|
|
|
|
row-key="id"
|
|
|
|
|
highlight-current-row
|
|
|
|
|
@current-change="handleCurrentChange"
|
|
|
|
|
@selection-change="handleSelectionChange"
|
|
|
|
|
>
|
|
|
|
|
<el-table-column type="selection" width="55" fixed="left" reserve-selection />
|
|
|
|
|
<el-table-column label="型号编码" align="center" prop="code"/>
|
|
|
|
|
<el-table-column label="型号名称" align="left" prop="name"/>
|
|
|
|
|
<el-table-column label="规格" align="center" prop="moldType" />
|
|
|
|
|
@ -168,26 +153,31 @@
|
|
|
|
|
<!-- 表单弹窗:添加/修改 -->
|
|
|
|
|
<MoldBrandForm ref="formRef" @success="getList" />
|
|
|
|
|
<!-- 子表的列表 -->
|
|
|
|
|
<ContentWrap>
|
|
|
|
|
<ContentWrap v-if="currentBrandId">
|
|
|
|
|
<div class="mb-10px text-14px font-600">
|
|
|
|
|
{{ currentBrandDisplay }}
|
|
|
|
|
</div>
|
|
|
|
|
<el-tabs model-value="mold">
|
|
|
|
|
<el-tab-pane label="模具" name="mold">
|
|
|
|
|
<MoldList :brand-id="currentRow.id" />
|
|
|
|
|
</el-tab-pane>
|
|
|
|
|
<el-tab-pane label="产品" name="moldBrandProduct">
|
|
|
|
|
<MoldBrandProductList :brand-id="currentRow.id" />
|
|
|
|
|
<MoldList :brand-id="currentBrandId" />
|
|
|
|
|
</el-tab-pane>
|
|
|
|
|
<!-- <el-tab-pane label="产品" name="moldBrandProduct">
|
|
|
|
|
<MoldBrandProductList :brand-id="currentBrandId" />
|
|
|
|
|
</el-tab-pane> -->
|
|
|
|
|
</el-tabs>
|
|
|
|
|
</ContentWrap>
|
|
|
|
|
<ContentWrap v-else>
|
|
|
|
|
<el-empty description="请先点击上方列表选择一个模具型号" />
|
|
|
|
|
</ContentWrap>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
|
|
|
|
|
import { getStrDictOptions, DICT_TYPE } from '@/utils/dict'
|
|
|
|
|
import { dateFormatter } from '@/utils/formatTime'
|
|
|
|
|
import download from '@/utils/download'
|
|
|
|
|
import { MoldBrandApi, MoldBrandVO } from '@/api/erp/mold'
|
|
|
|
|
import MoldBrandForm from './MoldBrandForm.vue'
|
|
|
|
|
import MoldList from './components/MoldList.vue'
|
|
|
|
|
import { ProductApi, ProductVO } from '@/api/erp/product/product'
|
|
|
|
|
import MoldBrandProductList from './components/MoldBrandProductList.vue'
|
|
|
|
|
|
|
|
|
|
/** 模具型号 列表 */
|
|
|
|
|
@ -195,7 +185,6 @@ defineOptions({ name: 'MoldBrand' })
|
|
|
|
|
|
|
|
|
|
const message = useMessage() // 消息弹窗
|
|
|
|
|
const { t } = useI18n() // 国际化
|
|
|
|
|
const productList = ref<ProductVO[]>([]) // 产品列表
|
|
|
|
|
const loading = ref(true) // 列表的加载中
|
|
|
|
|
const list = ref<MoldBrandVO[]>([]) // 列表的数据
|
|
|
|
|
const total = ref(0) // 列表的总页数
|
|
|
|
|
@ -204,6 +193,7 @@ const queryParams = reactive({
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
code: undefined,
|
|
|
|
|
name: undefined,
|
|
|
|
|
orgType: undefined,
|
|
|
|
|
moldType: undefined,
|
|
|
|
|
productId: undefined,
|
|
|
|
|
useTime: [],
|
|
|
|
|
@ -216,6 +206,13 @@ const queryParams = reactive({
|
|
|
|
|
})
|
|
|
|
|
const queryFormRef = ref() // 搜索的表单
|
|
|
|
|
const exportLoading = ref(false) // 导出的加载中
|
|
|
|
|
const orgTypeOptions = computed(() => getStrDictOptions(DICT_TYPE.MES_ORG_TYPE))
|
|
|
|
|
|
|
|
|
|
const tableRef = ref()
|
|
|
|
|
const selectedIds = ref<Array<number | string>>([])
|
|
|
|
|
const handleSelectionChange = (rows: any[]) => {
|
|
|
|
|
selectedIds.value = rows?.map((row) => row.id).filter((id) => id !== undefined && id !== null && id !== '') ?? []
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 查询列表 */
|
|
|
|
|
const getList = async () => {
|
|
|
|
|
@ -267,7 +264,10 @@ const handleExport = async () => {
|
|
|
|
|
await message.exportConfirm()
|
|
|
|
|
// 发起导出
|
|
|
|
|
exportLoading.value = true
|
|
|
|
|
const data = await MoldBrandApi.exportMoldBrand(queryParams)
|
|
|
|
|
const data = await MoldBrandApi.exportMoldBrand({
|
|
|
|
|
...queryParams,
|
|
|
|
|
...(selectedIds.value.length ? { ids: selectedIds.value.join(',') } : {})
|
|
|
|
|
})
|
|
|
|
|
download.excel(data, '模具型号.xls')
|
|
|
|
|
} catch {
|
|
|
|
|
} finally {
|
|
|
|
|
@ -276,15 +276,18 @@ const handleExport = async () => {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 选中行操作 */
|
|
|
|
|
const currentRow = ref({}) // 选中行
|
|
|
|
|
const handleCurrentChange = (row) => {
|
|
|
|
|
const currentRow = ref<MoldBrandVO | null>(null) // 选中行
|
|
|
|
|
const currentBrandId = computed(() => currentRow.value?.id)
|
|
|
|
|
const currentBrandDisplay = computed(() => {
|
|
|
|
|
if (!currentRow.value) return ''
|
|
|
|
|
return `${currentRow.value.name}-${currentRow.value.code}`
|
|
|
|
|
})
|
|
|
|
|
const handleCurrentChange = (row: MoldBrandVO | null) => {
|
|
|
|
|
currentRow.value = row
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 初始化 **/
|
|
|
|
|
onMounted(async () => {
|
|
|
|
|
await getList()
|
|
|
|
|
// 加载产品、
|
|
|
|
|
productList.value = await ProductApi.getMesProductSimpleList()
|
|
|
|
|
})
|
|
|
|
|
</script>
|
|
|
|
|
|