diff --git a/.env.development b/.env.development index 8bcc5d2..b7b7e07 100644 --- a/.env.development +++ b/.env.development @@ -1,5 +1,5 @@ NODE_ENV = 'development' VITE_NOW_TYPE = 'dist' # Base API -VITE_APP_BASE_URL='http://192.168.1.22:8546' +VITE_APP_BASE_URL='http://192.168.1.14:8546' # VITE_APP_BASE_URL='https://erp.lihaink.cn' \ No newline at end of file diff --git a/src/api/address.ts b/src/api/address.ts new file mode 100644 index 0000000..a520c64 --- /dev/null +++ b/src/api/address.ts @@ -0,0 +1,26 @@ +import request from '@/utils/request' + +// 仓库信息表列表 +export function apigetProvinceLists() { + return request.get({ url: '/geo/province' }) +} +// 仓库信息表列表 +export function apicityLists(params: any) { + return request.get({ url: '/geo/city', params }) +} + +// 仓库信息表列表 +export function apiAreaLists(params: any) { + return request.get({ url: '/geo/area', params }) +} + +// 仓库信息表列表 +export function apiStreetLists(params: any) { + return request.get({ url: '/geo/street', params }) +} + + +// 仓库信息表列表 +export function apiVillageLists(params: any) { + return request.get({ url: '/geo/village', params }) +} diff --git a/src/api/cashierclass.ts b/src/api/cashierclass.ts index efc09aa..fa8e338 100644 --- a/src/api/cashierclass.ts +++ b/src/api/cashierclass.ts @@ -23,4 +23,9 @@ export function apiCashierclassDelete(params: any) { // 零售单详情 export function apiCashierclassDetail(params: any) { return request.get({ url: '/retail/cashierclass/detail', params }) +} + +// 零售单详情 +export function apiCashierclassAuditing(params: any) { + return request.post({ url: '/retail/cashierclass/auditing', params }) } \ No newline at end of file diff --git a/src/components/dialogTable/dialogTableConfig.ts b/src/components/dialogTable/dialogTableConfig.ts new file mode 100644 index 0000000..65dd418 --- /dev/null +++ b/src/components/dialogTable/dialogTableConfig.ts @@ -0,0 +1,39 @@ +interface Iconfig { + /** 请求列表的接口*/ + fetchFn: Function; + + /**用户可搜索的内容,select为下拉列表,select为数组时为自定义option,w为string时表示获取字典里的值 */ + serchList: Array<{ + label: String; + value: String; + select?: Array<{ name: string; value: string | Number }> | String; + }>; + + /**需要的字典数据,以,隔开的string */ + dictData?: String; + + /**table配置 */ + tableList: Array; +} + + +import { apiGoodsLabelLists } from '@/api/goods_label' + +export const goods_label: Iconfig = { + fetchFn: apiGoodsLabelLists, + serchList: [ + // { + // label: "项目名称", + // value: "project_name", + // }, + // { + // label: "项目编号", + // value: "project_code", + // }, + ], + tableList: [ + { id: "ID" }, + { name: "标签名" }, + ], +}; + diff --git a/src/components/dialogTable/index.vue b/src/components/dialogTable/index.vue new file mode 100644 index 0000000..355ef97 --- /dev/null +++ b/src/components/dialogTable/index.vue @@ -0,0 +1,117 @@ + + + \ No newline at end of file diff --git a/src/views/data/merchant/merchant/edit.vue b/src/views/data/merchant/merchant/edit.vue index 7923a02..e76ee4b 100644 --- a/src/views/data/merchant/merchant/edit.vue +++ b/src/views/data/merchant/merchant/edit.vue @@ -29,6 +29,14 @@ + + + + + + + + @@ -42,7 +50,7 @@ - + @@ -50,7 +58,10 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -76,11 +122,11 @@ - + @@ -146,6 +192,14 @@ + + + + + + + @@ -156,7 +210,8 @@ import type { FormInstance } from 'element-plus' import Popup from '@/components/popup/index.vue' import { apiMerchantAdd, apiMerchantEdit, apiMerchantDetail } from '@/api/merchant' -import { timeFormat } from '@/utils/util' +import { apicityLists, apiAreaLists, apiStreetLists, apiVillageLists } from "@/api/address" + import type { PropType } from 'vue' defineProps({ dictData: { @@ -177,13 +232,16 @@ const popupTitle = computed(() => { // 表单数据 const formData = reactive({ + financial_type: "", mer_id: '', category_id: '', type_id: '', mer_name: '', + service_user: "", credit_buy: '', settle_cycle: '', interest_rate: '', + province_id: '510000', city_id: '', area_id: '', street_id: '', @@ -273,7 +331,9 @@ const setFormData = async (data: Record) => { formData[key] = data[key] } } - + await getAreaList(formData.city_id, true) + await getTownList(formData.area_id, true) + getVilllageList(formData.street_id) } @@ -308,6 +368,54 @@ const handleClose = () => { } +// 地址 +const address = reactive({ + cityList: [], + areaList: [], + townList: [], + villlageList: [] +}) + +const getCityList = async (province_code: number | String, isAsync: Boolean) => { + let res = await apicityLists({ province_code }) + address.cityList = res + if (isAsync) { + return Promise.resolve({ + msg: '获取成功' + }); + } +} + + +const getAreaList = async (city_code: number | String, isAsync: Boolean) => { + let res = await apiAreaLists({ city_code }) + address.areaList = res + if (isAsync) { + return Promise.resolve({ + msg: '获取成功' + }); + } +} + + +const getTownList = async (area_code: number | String, isAsync: Boolean) => { + let res = await apiStreetLists({ area_code }) + address.townList = res + if (isAsync) { + return Promise.resolve({ + msg: '获取成功' + }); + } +} + +const getVilllageList = async (street_code: number | String) => { + let res = await apiVillageLists({ street_code }) + address.villlageList = res +} +// 地址结束 + +getCityList(510000, false) + defineExpose({ open, diff --git a/src/views/data/merchant/merchant/index.vue b/src/views/data/merchant/merchant/index.vue index 2760c51..fc6d1dc 100644 --- a/src/views/data/merchant/merchant/index.vue +++ b/src/views/data/merchant/merchant/index.vue @@ -125,10 +125,10 @@ - - - - + + + + @@ -196,7 +196,7 @@ const handleSelectionChange = (val: any[]) => { } // 获取字典数据 -const { dictData } = useDictData('mer_category_type,merchat_type,show_status,off_status') +const { dictData } = useDictData('mer_category_type,merchat_type,show_status,off_status,financial_type') // 分页相关 const { pager, getLists, resetParams, resetPage } = usePaging({ diff --git a/src/views/data/supplier/supplier/edit.vue b/src/views/data/supplier/supplier/edit.vue index e6310f4..db23adf 100644 --- a/src/views/data/supplier/supplier/edit.vue +++ b/src/views/data/supplier/supplier/edit.vue @@ -43,27 +43,43 @@ - + - + + + - + + + - + + + - + + + @@ -146,12 +162,18 @@ - + + + + + + + @@ -160,6 +182,11 @@ import type { FormInstance } from 'element-plus' import Popup from '@/components/popup/index.vue' import { apiSupplierAdd, apiSupplierEdit, apiSupplierDetail } from '@/api/supplier' +import { apicityLists, apiAreaLists, apiStreetLists, apiVillageLists } from "@/api/address" +import { goods_label } from "@/components/dialogTable/dialogTableConfig" + + + import type { PropType } from 'vue' defineProps({ dictData: { @@ -171,7 +198,7 @@ const emit = defineEmits(['success', 'close']) const formRef = shallowRef() const popupRef = shallowRef>() const mode = ref('add') - +const showDialog = ref(false) // 弹窗标题 const popupTitle = computed(() => { @@ -186,7 +213,9 @@ const formData = reactive({ mer_name: '', settle_cycle: '', interest_rate: '', - sys_labels: '', + sys_labels: [], + sys_labels_text: '', + province_id: '510000', city_id: '', area_id: '', street_id: '', @@ -207,6 +236,18 @@ const formData = reactive({ financial_type: '', }) +const customEvent = (e) => { + formData.sys_labels = [] + let text = [] + e.forEach(item => { + formData.sys_labels.push(item.id) + text.push(item.name) + }); + formData.sys_labels_text = text.join(',') + formData.sys_labels = formData.sys_labels.join(',') + showDialog.value = false +} + // 表单验证 const formRules = reactive({ @@ -266,7 +307,9 @@ const setFormData = async (data: Record) => { formData[key] = data[key] } } - + await getAreaList(formData.city_id, true) + await getTownList(formData.area_id, true) + getVilllageList(formData.street_id) } @@ -299,7 +342,7 @@ const open = (type = 'add') => { const handleClose = () => { emit('close') } - +// 510000 // 地址 @@ -310,6 +353,45 @@ const address = reactive({ villlageList: [] }) +const getCityList = async (province_code: number | String, isAsync: Boolean) => { + let res = await apicityLists({ province_code }) + address.cityList = res + if (isAsync) { + return Promise.resolve({ + msg: '获取成功' + }); + } +} + + +const getAreaList = async (city_code: number | String, isAsync: Boolean) => { + let res = await apiAreaLists({ city_code }) + address.areaList = res + if (isAsync) { + return Promise.resolve({ + msg: '获取成功' + }); + } +} + + +const getTownList = async (area_code: number | String, isAsync: Boolean) => { + let res = await apiStreetLists({ area_code }) + address.townList = res + if (isAsync) { + return Promise.resolve({ + msg: '获取成功' + }); + } +} + +const getVilllageList = async (street_code: number | String) => { + let res = await apiVillageLists({ street_code }) + address.villlageList = res +} +// 地址结束 + +getCityList(510000, false) defineExpose({ diff --git a/src/views/data/supplier/supplier/index.vue b/src/views/data/supplier/supplier/index.vue index d17b6e7..a2c47f9 100644 --- a/src/views/data/supplier/supplier/index.vue +++ b/src/views/data/supplier/supplier/index.vue @@ -62,7 +62,7 @@ - +