|
@@ -5,17 +5,18 @@
|
|
|
* @Author: Cheney
|
|
|
*/
|
|
|
|
|
|
-import type { FormInstance, FormRules } from 'element-plus';
|
|
|
+import { ElMessage, FormInstance, FormRules } from 'element-plus';
|
|
|
import { useResponse } from '/@/utils/useResponse';
|
|
|
import * as api from '/@/views/shop-information/api';
|
|
|
|
|
|
|
|
|
const loading = ref(false);
|
|
|
const isOpen = defineModel({ default: false });
|
|
|
-const { gridOptions, platformNumber, formSelect } = defineProps<{
|
|
|
+const { gridOptions, platformNumber, formSelect, companySelect } = defineProps<{
|
|
|
gridOptions: any;
|
|
|
platformNumber: any;
|
|
|
formSelect: any;
|
|
|
+ companySelect: any;
|
|
|
}>();
|
|
|
|
|
|
const emit = defineEmits([ 'refresh' ]);
|
|
@@ -36,6 +37,7 @@ interface RuleForm {
|
|
|
line: string[];
|
|
|
ipaddress: string;
|
|
|
company: string;
|
|
|
+ belongsCompany: string;
|
|
|
companyEnglishName: string;
|
|
|
address: string; // 新增
|
|
|
juridicalPerson: string; // 新增
|
|
@@ -64,6 +66,7 @@ const ruleForm = reactive<RuleForm>({
|
|
|
line: [],
|
|
|
ipaddress: '',
|
|
|
company: '',
|
|
|
+ belongsCompany: '',
|
|
|
companyEnglishName: '',
|
|
|
address: '',
|
|
|
juridicalPerson: '',
|
|
@@ -110,6 +113,7 @@ const rules = reactive<FormRules<RuleForm>>({
|
|
|
company: [
|
|
|
{ message: 'Please input activity form', trigger: 'blur' }
|
|
|
],
|
|
|
+ belongsCompany: [ { required: true, message: 'Please Select belongsCompany', trigger: 'change' } ],
|
|
|
companyEnglishName: [
|
|
|
{ message: 'Please input Company English Name', trigger: 'blur' }
|
|
|
],
|
|
@@ -157,6 +161,7 @@ const submitForm = async (formEl: FormInstance | undefined) => {
|
|
|
if (valid) {
|
|
|
await useResponse({ id: gridOptions.data[0].id, partial: 1, formData: ruleForm }, api.updateShopDetail, loading);
|
|
|
isOpen.value = false;
|
|
|
+ ElMessage.success('编辑成功');
|
|
|
emit('refresh');
|
|
|
} else {
|
|
|
console.log('error submit!', fields);
|
|
@@ -236,6 +241,16 @@ function replaceCol() {
|
|
|
<el-form-item label="公司" prop="company">
|
|
|
<el-input v-model="ruleForm.company"/>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="关联公司" prop="belongsCompany">
|
|
|
+ <el-select v-model="ruleForm.belongsCompany" placeholder="请选择所属公司">
|
|
|
+ <el-option
|
|
|
+ v-for="item in companySelect"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.company"
|
|
|
+ :value="item.id">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="公司英文名称" prop="companyEnglishName">
|
|
|
<el-input v-model="ruleForm.companyEnglishName"/>
|
|
|
</el-form-item>
|