This commit is contained in:
zmj 2024-05-21 18:50:45 +08:00
parent afca312830
commit 6b8f86f21c
2 changed files with 16 additions and 10 deletions

View File

@ -1,5 +1,5 @@
NODE_ENV = 'development' NODE_ENV = 'development'
VITE_NOW_TYPE = 'dist' VITE_NOW_TYPE = 'dist'
# Base API # Base API
VITE_APP_BASE_URL='http://192.168.1.13:8546' # VITE_APP_BASE_URL='http://192.168.1.13:8546'
# VITE_APP_BASE_URL='https://erp.lihaink.cn' VITE_APP_BASE_URL='https://erp.lihaink.cn'

View File

@ -127,13 +127,13 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="供应商电话" prop="service_phone"> <el-form-item label="供应商电话" prop="phone">
<el-input v-model="formData.service_phone" clearable placeholder="请输入供应商电话" :readonly="false" /> <el-input v-model="formData.phone" clearable placeholder="请输入供应商电话" :readonly="false" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="供应商余额" prop="mer_money"> <el-form-item label="供应商余额">
<el-input v-model="formData.mer_money" clearable placeholder="请输入供应商余额" :readonly="false" /> <el-input v-model="formData.mer_money" clearable placeholder="请输入供应商余额" readonly />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
@ -236,12 +236,13 @@ const formData = reactive({
commission_switch: '', commission_switch: '',
long: '', long: '',
lat: '', lat: '',
service_phone: '', phone: '',
mer_money: '', mer_money: '',
financial_bank: '', financial_bank: '',
financial_wechat: '', financial_wechat: '',
financial_alipay: '', financial_alipay: '',
financial_type: '', financial_type: '',
service_phone: "",
sys_labels_arr: [] sys_labels_arr: []
}) })
const dataJSON = ref({}) const dataJSON = ref({})
@ -292,7 +293,7 @@ const formRules = reactive<any>({
message: '请选择供应商是否禁用0锁定,1正常', message: '请选择供应商是否禁用0锁定,1正常',
trigger: ['blur'] trigger: ['blur']
}], }],
service_phone: [{ phone: [{
required: true, required: true,
message: '请输入供应商电话', message: '请输入供应商电话',
trigger: ['blur'] trigger: ['blur']
@ -318,8 +319,12 @@ const setFormData = async (data: Record<any, any>) => {
formData[key] = data[key] formData[key] = data[key]
} }
} }
dataJSON.value = JSON.parse(data.data_json||'{}'); formData.phone = formData.service_phone || formData.phone
if(!formData.mer_address) formData.mer_address = dataJSON.value.company_address; formData.financial_type = data.financial_type == 0 ? '' : data.financial_type
formData.sys_labels_text = data.sys_labels_text
dataJSON.value = JSON.parse(data.data_json || '{}')
dataJSON.value = JSON.parse(data.data_json || '{}');
if (!formData.mer_address) formData.mer_address = dataJSON.value.company_address;
await getAreaList(formData.city_id, true) await getAreaList(formData.city_id, true)
await getTownList(formData.area_id, true) await getTownList(formData.area_id, true)
getVilllageList(formData.street_id) getVilllageList(formData.street_id)
@ -340,6 +345,7 @@ const getDetail = async (row: Record<string, any>) => {
const handleSubmit = async () => { const handleSubmit = async () => {
await formRef.value?.validate() await formRef.value?.validate()
const data = { ...formData, } const data = { ...formData, }
data.phone = data.service_phone || data.phone
data.sys_labels = data.sys_labels_arr.map(item => { data.sys_labels = data.sys_labels_arr.map(item => {
return item.id return item.id
}).join(',') }).join(',')