|
@@ -19,17 +19,43 @@
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
<el-col :span="24">
|
|
<el-col :span="24">
|
|
|
|
|
+ <el-form-item prop="contractPhone" label="门店账号/手机号">
|
|
|
|
|
+ <el-input v-model="formData.contractPhone"/>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="24">
|
|
|
<el-form-item prop="idBrand" label="选择品牌">
|
|
<el-form-item prop="idBrand" label="选择品牌">
|
|
|
<el-select v-model="formData.idBrand" placeholder="请选择" style="width: 320px">
|
|
<el-select v-model="formData.idBrand" placeholder="请选择" style="width: 320px">
|
|
|
<el-option
|
|
<el-option
|
|
|
v-for="type in optionsList"
|
|
v-for="type in optionsList"
|
|
|
- :key="type.storeInfo.id"
|
|
|
|
|
- :label="type.storeInfo"
|
|
|
|
|
- :value="type.storeInfo">
|
|
|
|
|
|
|
+ :key="type.id"
|
|
|
|
|
+ :label="type.brandName"
|
|
|
|
|
+ :value="type.id">
|
|
|
</el-option>
|
|
</el-option>
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
|
|
+ <el-col :span="24">
|
|
|
|
|
+ <el-form-item prop="storeCodeInput" label="门店编码">
|
|
|
|
|
+ <el-input v-model="formData.storeCodeInput"/>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+
|
|
|
|
|
+ <el-col :span="24">
|
|
|
|
|
+ <el-form-item prop="" label="省市区">
|
|
|
|
|
+ <el-cascader
|
|
|
|
|
+ class="w320px"
|
|
|
|
|
+ :options="areaTree"
|
|
|
|
|
+ v-model="selectedOptions"
|
|
|
|
|
+ @change="handleChange">
|
|
|
|
|
+ </el-cascader>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="24">
|
|
|
|
|
+ <el-form-item prop="storeAddress" label="详细地址">
|
|
|
|
|
+ <el-input v-model="formData.storeAddress"/>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
</el-row>
|
|
</el-row>
|
|
|
|
|
|
|
|
</el-form>
|
|
</el-form>
|
|
@@ -44,16 +70,19 @@
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
|
-import {getViewStoreInfo, addStoreInfo, updateStoreInfo,queryStoreBrandList} from "@/api/store";
|
|
|
|
|
|
|
+import {getStoreInfo, addStoreInfo, updateStoreInfo,queryStoreBrandList} from "@/api/store";
|
|
|
import type {FormInstance} from 'element-plus'
|
|
import type {FormInstance} from 'element-plus'
|
|
|
|
|
|
|
|
let dialogVisible = ref(false)
|
|
let dialogVisible = ref(false)
|
|
|
let dialogTitle = ref("")
|
|
let dialogTitle = ref("")
|
|
|
const formRef = ref<FormInstance>()
|
|
const formRef = ref<FormInstance>()
|
|
|
const emit = defineEmits(['dialogChange'])
|
|
const emit = defineEmits(['dialogChange'])
|
|
|
|
|
+import areaData from '@/utils/area-data.ts';//地址数据
|
|
|
|
|
+let selectedOptions = ref([])
|
|
|
|
|
+let areaTree = ref([])
|
|
|
const formData = reactive({
|
|
const formData = reactive({
|
|
|
storeName:'',
|
|
storeName:'',
|
|
|
- idBrand:0,
|
|
|
|
|
|
|
+ idBrand:'',
|
|
|
brandName:'',
|
|
brandName:'',
|
|
|
deliverSettleKind:0,
|
|
deliverSettleKind:0,
|
|
|
storeCodeInput:'',
|
|
storeCodeInput:'',
|
|
@@ -62,6 +91,7 @@ const formData = reactive({
|
|
|
storeDistrict:'',
|
|
storeDistrict:'',
|
|
|
storeAddress:'',
|
|
storeAddress:'',
|
|
|
contractPhone:'',
|
|
contractPhone:'',
|
|
|
|
|
+ loginAccount:'',
|
|
|
id: ""
|
|
id: ""
|
|
|
})
|
|
})
|
|
|
const rules = reactive({
|
|
const rules = reactive({
|
|
@@ -74,7 +104,23 @@ function handleSubmit() {
|
|
|
const itemId = formData.id;
|
|
const itemId = formData.id;
|
|
|
if (itemId) {
|
|
if (itemId) {
|
|
|
//修改
|
|
//修改
|
|
|
- const postData = JSON.stringify(formData)
|
|
|
|
|
|
|
+ const data = {
|
|
|
|
|
+ id:formData.id,
|
|
|
|
|
+ storeName: formData.storeName,
|
|
|
|
|
+ idBrand: formData.idBrand,
|
|
|
|
|
+ idStoreType:1,
|
|
|
|
|
+ deliverSettleKind:0,
|
|
|
|
|
+ brandName: optionsList.value.find(x => x.id === formData.idBrand).brandName,
|
|
|
|
|
+ storeProvince: selectedOptions.value[0],
|
|
|
|
|
+ storeCity: selectedOptions.value[1],
|
|
|
|
|
+ storeDistrict: selectedOptions.value[2],
|
|
|
|
|
+ storeAddress: formData.storeAddress,
|
|
|
|
|
+ contractPhone: formData.contractPhone,
|
|
|
|
|
+ loginAccount: formData.contractPhone,
|
|
|
|
|
+ storeCodeInput: formData.storeCodeInput
|
|
|
|
|
+ }
|
|
|
|
|
+ console.log(data);
|
|
|
|
|
+ const postData = JSON.stringify(data)
|
|
|
const params = {
|
|
const params = {
|
|
|
"storeInfo": postData
|
|
"storeInfo": postData
|
|
|
}
|
|
}
|
|
@@ -86,8 +132,23 @@ function handleSubmit() {
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
} else {
|
|
} else {
|
|
|
|
|
+ const data = {
|
|
|
|
|
+ storeName: formData.storeName,
|
|
|
|
|
+ idBrand: formData.idBrand,
|
|
|
|
|
+ idStoreType:1,
|
|
|
|
|
+ deliverSettleKind:0,
|
|
|
|
|
+ brandName: optionsList.value.find(x => x.id === formData.idBrand).brandName,
|
|
|
|
|
+ storeProvince: selectedOptions.value[0],
|
|
|
|
|
+ storeCity: selectedOptions.value[1],
|
|
|
|
|
+ storeDistrict: selectedOptions.value[2],
|
|
|
|
|
+ storeAddress: formData.storeAddress,
|
|
|
|
|
+ contractPhone: formData.contractPhone,
|
|
|
|
|
+ loginAccount: formData.contractPhone,
|
|
|
|
|
+ storeCodeInput: formData.storeCodeInput
|
|
|
|
|
+ }
|
|
|
|
|
+ console.log(data);
|
|
|
//增加
|
|
//增加
|
|
|
- const postData = JSON.stringify(formData)
|
|
|
|
|
|
|
+ const postData = JSON.stringify(data)
|
|
|
const params = {
|
|
const params = {
|
|
|
"storeInfo": postData
|
|
"storeInfo": postData
|
|
|
}
|
|
}
|
|
@@ -116,7 +177,8 @@ function getOptionsList() {
|
|
|
queryStoreBrandList(data).then((response) => {
|
|
queryStoreBrandList(data).then((response) => {
|
|
|
if (response.httpCode == 200) {
|
|
if (response.httpCode == 200) {
|
|
|
const { data } = response
|
|
const { data } = response
|
|
|
- optionsList.value = JSON.parse(data)
|
|
|
|
|
|
|
+ optionsList.value = data
|
|
|
|
|
+ console.log(optionsList.value);
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
@@ -124,20 +186,27 @@ function getItemData(item) {
|
|
|
const data = {
|
|
const data = {
|
|
|
idStore: item
|
|
idStore: item
|
|
|
}
|
|
}
|
|
|
- getViewStoreInfo(data).then(response => {
|
|
|
|
|
|
|
+ getStoreInfo(data).then(response => {
|
|
|
if (response.httpCode == 200) {
|
|
if (response.httpCode == 200) {
|
|
|
const data = response.data
|
|
const data = response.data
|
|
|
Object.assign(formData, {...data});
|
|
Object.assign(formData, {...data});
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+function handleChange (value) {
|
|
|
|
|
+ selectedOptions.value = value
|
|
|
|
|
+}
|
|
|
/** 重置表单 */
|
|
/** 重置表单 */
|
|
|
function resetForm() {
|
|
function resetForm() {
|
|
|
formRef.value.resetFields();
|
|
formRef.value.resetFields();
|
|
|
formData.id = ''
|
|
formData.id = ''
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+onMounted(() => {
|
|
|
|
|
+ areaTree.value = areaData.pcaTextArr;
|
|
|
|
|
+ if(optionsList.value.length<=0){
|
|
|
|
|
+ getOptionsList()
|
|
|
|
|
+ }
|
|
|
|
|
+})
|
|
|
/**关闭弹窗 */
|
|
/**关闭弹窗 */
|
|
|
function closeDialog() {
|
|
function closeDialog() {
|
|
|
dialogVisible.value = false
|
|
dialogVisible.value = false
|