From b7253c386eb7eb61686fa3072203d203fd887ab9 Mon Sep 17 00:00:00 2001 From: zmj <1493694146@qq.com> Date: Thu, 16 May 2024 10:01:23 +0800 Subject: [PATCH] add --- .env.development | 4 +- src/components/dialogTable/index.vue | 2 - src/views/data/supplier/supplier/edit.vue | 32 +++++++------- src/views/goods/goods/edit.vue | 51 +++++++++-------------- src/views/retail/cashierclass/index.vue | 11 ++--- 5 files changed, 41 insertions(+), 59 deletions(-) diff --git a/.env.development b/.env.development index 6c9218a..8bcc5d2 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.144.1:8546' -VITE_APP_BASE_URL='https://erp.lihaink.cn' \ No newline at end of file +VITE_APP_BASE_URL='http://192.168.1.22:8546' +# VITE_APP_BASE_URL='https://erp.lihaink.cn' \ No newline at end of file diff --git a/src/components/dialogTable/index.vue b/src/components/dialogTable/index.vue index 92d3d78..1d7d86f 100644 --- a/src/components/dialogTable/index.vue +++ b/src/components/dialogTable/index.vue @@ -16,7 +16,6 @@ 查询 重置 - 重置
@@ -91,7 +90,6 @@ const emits = defineEmits(["customEvent"]); // 选中数据子父传递 const handleCurrentChange = (value: any) => { - console.log(multipleSelection.value) if (props.multipleChoice) return emits("customEvent", value); }; diff --git a/src/views/data/supplier/supplier/edit.vue b/src/views/data/supplier/supplier/edit.vue index 48bc417..dc3a1ea 100644 --- a/src/views/data/supplier/supplier/edit.vue +++ b/src/views/data/supplier/supplier/edit.vue @@ -163,13 +163,11 @@ - - {{ tag }} + + {{ item.name }} - 添加标签 - - @@ -188,10 +186,9 @@ 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: { type: Object as PropType>, @@ -238,17 +235,14 @@ const formData = reactive({ financial_wechat: '', financial_alipay: '', financial_type: '', + sys_labels_arr: [] }) const customEvent = (e) => { - formData.sys_labels = [] - let text = [] e.forEach(item => { - formData.sys_labels.push(item.id) - text.push(item.name) + formData.sys_labels_arr.push(item) }); - formData.sys_labels_text = text.join(',') - formData.sys_labels = formData.sys_labels.join(',') + formData.sys_labels_arr = Array.from(new Set(formData.sys_labels_arr.map(obj => JSON.stringify(obj)))).map(str => JSON.parse(str)); showDialog.value = false } @@ -302,6 +296,11 @@ const formRules = reactive({ }] }) +// 标签列表 +const delTags = (index: number) => { + formData.sys_labels_arr.splice(index, 1) +} + // 获取详情 const setFormData = async (data: Record) => { @@ -317,7 +316,6 @@ const setFormData = async (data: Record) => { if (data.financial_type == 0) { formData.financial_type = '' } - } const getDetail = async (row: Record) => { @@ -332,6 +330,9 @@ const getDetail = async (row: Record) => { const handleSubmit = async () => { await formRef.value?.validate() const data = { ...formData, } + data.sys_labels = data.sys_labels_arr.map(item => { + return item.id + }).join(',') mode.value == 'edit' ? await apiSupplierEdit(data) : await apiSupplierAdd(data) @@ -361,7 +362,6 @@ const address = reactive({ }) const getCityList = async (province_code: number | String, isAsync: Boolean) => { - if (!province_code) return; let res = await apicityLists({ province_code }) address.cityList = res diff --git a/src/views/goods/goods/edit.vue b/src/views/goods/goods/edit.vue index cb6b077..f044759 100644 --- a/src/views/goods/goods/edit.vue +++ b/src/views/goods/goods/edit.vue @@ -52,12 +52,6 @@ }" placeholder="请选择商品单位" /> - - - - - @@ -127,11 +121,20 @@ - + + + + + {{ item.name }} + + 添加标签 + + - +