Compare commits
2 Commits
a9e6b2eb28
...
94a9072e58
| Author | SHA1 | Date | |
|---|---|---|---|
| 94a9072e58 | |||
| f4fd13b81d |
@ -0,0 +1,97 @@
|
||||
<template>
|
||||
<Dialog :title="dialogTitle" v-model="dialogVisible" width="800px">
|
||||
<el-form :model="queryParams" inline label-width="80px">
|
||||
<el-form-item label="检索条件">
|
||||
<el-input v-model="queryParams.keyWord" placeholder="请输入机台编码或者机台名称" clearable class="!w-200px" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="searchMachine">搜索</el-button>
|
||||
<el-button @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table ref="tableRef" v-loading="loading" :data="machineList" :show-overflow-tooltip="true" class="mt-15px" @selection-change="handleSelection">
|
||||
<el-table-column type="selection" width="50px" />
|
||||
<el-table-column label="序号" width="60px" align="center" type="index" />
|
||||
<el-table-column label="机台编码" align="center" prop="machineCd" />
|
||||
<el-table-column label="机台名称" align="center" prop="machineName" />
|
||||
<el-table-column label="创建人" align="center" prop="createBy" />
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" :formatter="dateFormatter2" />
|
||||
</el-table>
|
||||
<template #footer>
|
||||
<el-button @click="confirmSelection" type="primary">确 定</el-button>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
</template>
|
||||
</Dialog>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, nextTick } from 'vue'
|
||||
import { dateFormatter2 } from '@/utils/formatTime'
|
||||
import * as MachineApi from '@/api/biz/machine'
|
||||
|
||||
const message = useMessage()
|
||||
|
||||
const dialogVisible = ref(false)
|
||||
const dialogTitle = ref('选择机台')
|
||||
const loading = ref(false)
|
||||
const machineList = ref([])
|
||||
const selection = ref([])
|
||||
const tableRef = ref()
|
||||
const selectedMachineIds = ref([])
|
||||
|
||||
const queryParams = reactive({
|
||||
keyWord: undefined
|
||||
})
|
||||
|
||||
const emit = defineEmits(['confirm'])
|
||||
|
||||
const open = (selectedIds: number[] = []) => {
|
||||
dialogVisible.value = true
|
||||
selection.value = []
|
||||
selectedMachineIds.value = selectedIds
|
||||
searchMachine()
|
||||
}
|
||||
|
||||
const searchMachine = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await MachineApi.getMachinePage(queryParams)
|
||||
machineList.value = data.list || []
|
||||
await nextTick(() => {
|
||||
if (tableRef.value && selectedMachineIds.value.length > 0) {
|
||||
machineList.value.forEach(item => {
|
||||
if (selectedMachineIds.value.includes(item.id)) {
|
||||
tableRef.value.toggleRowSelection(item, true)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const resetQuery = () => {
|
||||
queryParams.keyWord = undefined
|
||||
searchMachine()
|
||||
}
|
||||
|
||||
const handleSelection = (val: any[]) => {
|
||||
selection.value = val
|
||||
}
|
||||
|
||||
const confirmSelection = () => {
|
||||
if (selection.value.length === 0) {
|
||||
message.warning('请选择机台')
|
||||
return
|
||||
}
|
||||
emit('confirm', selection.value)
|
||||
dialogVisible.value = false
|
||||
}
|
||||
|
||||
defineExpose({ open })
|
||||
</script>
|
||||
<style scoped>
|
||||
.mt-15px {
|
||||
margin-top: 15px;
|
||||
}
|
||||
</style>
|
||||
@ -0,0 +1,228 @@
|
||||
<template>
|
||||
<Dialog :title="dialogTitle" v-model="dialogVisible" width="1200px">
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
label-width="110px"
|
||||
v-loading="formLoading"
|
||||
>
|
||||
<!-- 基础信息 -->
|
||||
<div class="form-section">
|
||||
<div class="section-title">基础信息</div>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="供应商编码">
|
||||
<el-input v-model="formData.supplierNo" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="供应商名称">
|
||||
<el-input v-model="formData.supplierName" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="简称">
|
||||
<el-input v-model="formData.supplierSimName" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="供应商类型">
|
||||
<el-select v-model="formData.supplierType" disabled>
|
||||
<el-option
|
||||
v-for="dict in getStrDictOptions(DICT_TYPE.SUPPLIER_TYPE)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="供应商等级">
|
||||
<el-select v-model="formData.supplierReg" disabled>
|
||||
<el-option
|
||||
v-for="dict in getStrDictOptions(DICT_TYPE.SUPPLIER_GRADE)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="公司税号">
|
||||
<el-input v-model="formData.comTaxNumber" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="启用状态">
|
||||
<el-select v-model="formData.enabledStatus" disabled>
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.SYSTEM_STATUS)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="供应商状态">
|
||||
<el-select v-model="formData.status" disabled>
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.SUPPLIER_STATUS)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="是否黑名单">
|
||||
<el-select v-model="formData.isBlacklist" disabled>
|
||||
<el-option label="是" :value="1" />
|
||||
<el-option label="否" :value="0" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="formData.remark" type="textarea" :rows="2" disabled />
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
<!-- 联系方式 -->
|
||||
<div class="form-section">
|
||||
<div class="section-title">联系方式</div>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="联系人1">
|
||||
<el-input v-model="formData.contact1" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="联系电话1">
|
||||
<el-input v-model="formData.conPhone1" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="联系地址1">
|
||||
<el-input v-model="formData.conAddress1" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="联系人2">
|
||||
<el-input v-model="formData.contact2" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="联系电话2">
|
||||
<el-input v-model="formData.conPhone2" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="联系地址2">
|
||||
<el-input v-model="formData.conAddress2" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
<!-- 银行信息 -->
|
||||
<div class="form-section">
|
||||
<div class="section-title">银行信息</div>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="开户地区">
|
||||
<el-input v-model="formData.accountRegion" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="开户银行">
|
||||
<el-input v-model="formData.accountBank" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="开户账号">
|
||||
<el-input v-model="formData.accountNo" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="dialogVisible = false">关 闭</el-button>
|
||||
</template>
|
||||
</Dialog>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { getStrDictOptions, getIntDictOptions, DICT_TYPE } from '@/utils/dict'
|
||||
import * as SupplierApi from '@/api/biz/supplier'
|
||||
|
||||
const dialogVisible = ref(false)
|
||||
const dialogTitle = ref('查看详情')
|
||||
const formLoading = ref(false)
|
||||
const formData = ref({
|
||||
id: undefined,
|
||||
supplierNo: undefined,
|
||||
supplierName: undefined,
|
||||
supplierSimName: undefined,
|
||||
supplierType: undefined,
|
||||
supplierReg: undefined,
|
||||
contact1: undefined,
|
||||
conPhone1: undefined,
|
||||
conAddress1: undefined,
|
||||
contact2: undefined,
|
||||
conPhone2: undefined,
|
||||
conAddress2: undefined,
|
||||
comTaxNumber: undefined,
|
||||
accountRegion: undefined,
|
||||
accountBank: undefined,
|
||||
accountNo: undefined,
|
||||
remark: undefined,
|
||||
enabledStatus: 0,
|
||||
status: 1,
|
||||
isBlacklist: 0,
|
||||
})
|
||||
|
||||
const open = async (id: number) => {
|
||||
dialogVisible.value = true
|
||||
formLoading.value = true
|
||||
try {
|
||||
const data = await SupplierApi.getSupplier(id)
|
||||
if (data.enabledStatus !== undefined && data.enabledStatus !== null) {
|
||||
data.enabledStatus = Number(data.enabledStatus)
|
||||
}
|
||||
if (data.status !== undefined && data.status !== null) {
|
||||
data.status = Number(data.status)
|
||||
}
|
||||
if (data.isBlacklist !== undefined && data.isBlacklist !== null) {
|
||||
data.isBlacklist = Number(data.isBlacklist)
|
||||
}
|
||||
formData.value = data
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
defineExpose({ open })
|
||||
</script>
|
||||
<style scoped>
|
||||
.form-section {
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
.section-title {
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: #606266;
|
||||
margin-bottom: 16px;
|
||||
padding-left: 8px;
|
||||
border-left: 3px solid #409eff;
|
||||
}
|
||||
</style>
|
||||
Loading…
Reference in New Issue
Block a user