|
|
|
|
@ -324,6 +324,9 @@
|
|
|
|
|
t('FactoryModeling.ProductInformation.searchButtonText') }}</el-button>
|
|
|
|
|
<el-button @click="resetSupplierSearch">{{ t('FactoryModeling.ProductInformation.resetButtonText')
|
|
|
|
|
}}</el-button>
|
|
|
|
|
<el-button type="primary" plain @click="openSupplierCreateForm" v-hasPermi="['erp:supplier:create']">
|
|
|
|
|
<Icon icon="ep:plus" class="mr-5px" /> {{ t('action.create') }}
|
|
|
|
|
</el-button>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
<el-table ref="supplierTableRef" v-loading="supplierDialogLoading" :data="supplierDialogList"
|
|
|
|
|
@ -353,6 +356,7 @@
|
|
|
|
|
</template>
|
|
|
|
|
</Dialog>
|
|
|
|
|
<PackagingSolutionForm ref="packagingSolutionFormRef" @success="handlePackagingSchemeSuccess" />
|
|
|
|
|
<SupplierForm ref="supplierFormRef" @success="handleSupplierCreateSuccess" />
|
|
|
|
|
</template>
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
import { ProductApi, ProductVO } from '@/api/erp/product/product'
|
|
|
|
|
@ -365,6 +369,7 @@ import { MoldBrandApi } from '@/api/erp/mold'
|
|
|
|
|
import { PackagingSchemeApi } from '@/api/erp/stock/packagingScheme'
|
|
|
|
|
import PackagingSolutionForm from '@/views/erp/stock/packagingSolution/PackagingSolutionForm.vue'
|
|
|
|
|
import { SupplierApi } from '@/api/erp/purchase/supplier'
|
|
|
|
|
import SupplierForm from '@/views/erp/purchase/supplier/SupplierForm.vue'
|
|
|
|
|
import { CommonStatusEnum } from '@/utils/constants'
|
|
|
|
|
import { defaultProps, handleTree } from '@/utils/tree'
|
|
|
|
|
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
|
|
|
|
@ -792,6 +797,7 @@ const supplierSelectedRows = ref<any[]>([])
|
|
|
|
|
const supplierDefaultId = ref<number | undefined>(undefined)
|
|
|
|
|
const searchSupplierParams = reactive({ name: undefined, mobile: undefined })
|
|
|
|
|
const searchSupplierFormRef = ref()
|
|
|
|
|
const supplierFormRef = ref()
|
|
|
|
|
|
|
|
|
|
const getSupplierDialogList = async () => {
|
|
|
|
|
supplierDialogLoading.value = true
|
|
|
|
|
@ -890,6 +896,17 @@ const resetSupplierSearch = () => {
|
|
|
|
|
searchSupplierFormRef.value?.resetFields()
|
|
|
|
|
handleSupplierSearch()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const openSupplierCreateForm = () => {
|
|
|
|
|
supplierFormRef.value?.open('create')
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const handleSupplierCreateSuccess = async () => {
|
|
|
|
|
supplierDialogPageNo.value = 1
|
|
|
|
|
await getSupplierDialogList()
|
|
|
|
|
const data = await SupplierApi.getSupplierPage({ pageNo: 1, pageSize: 100, status: 0 })
|
|
|
|
|
supplierList.value = data.list || []
|
|
|
|
|
}
|
|
|
|
|
const formRules = reactive({
|
|
|
|
|
categoryType: [{ required: true, message: t('FactoryModeling.ProductInformation.validatorCategoryTypeRequired'), trigger: 'change' }],
|
|
|
|
|
name: [{ required: true, message: t('FactoryModeling.ProductInformation.validatorNameRequired'), trigger: 'blur' }],
|
|
|
|
|
|