Commit 8954a046 authored by tanghao's avatar tanghao

品牌编码

parent 44fd99a2
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
<vxe-modal <vxe-modal
v-model="showEdit" v-model="showEdit"
@hide="onHide" @hide="onHide"
:z-index="1006"
title="品牌选择" title="品牌选择"
width="800" width="800"
destroy-on-close destroy-on-close
...@@ -27,7 +28,8 @@ ...@@ -27,7 +28,8 @@
</el-form> </el-form>
<vxe-table ref="xTable" border :data="tableData" :loading="loading" size="small" height="400"> <vxe-table ref="xTable" border :data="tableData" :loading="loading" size="small" height="400">
<vxe-column type="checkbox" width="40"></vxe-column> <!-- <vxe-column type="checkbox" width="40"></vxe-column> -->
<vxe-column type="radio" width="40"></vxe-column>
<vxe-column field="brandId" title="id" width="200"></vxe-column> <vxe-column field="brandId" title="id" width="200"></vxe-column>
<vxe-column field="brandName" title="品牌名称" width="150"></vxe-column> <vxe-column field="brandName" title="品牌名称" width="150"></vxe-column>
<vxe-column field="brandCode" title="品牌编码" width="120"></vxe-column> <vxe-column field="brandCode" title="品牌编码" width="120"></vxe-column>
...@@ -105,8 +107,9 @@ export default defineComponent({ ...@@ -105,8 +107,9 @@ export default defineComponent({
} }
const confirmModal = () => { const confirmModal = () => {
const list = xTable.value?.getCheckboxRecords() const list = xTable.value?.getRadioRecord()
emit('confirm', list) emit('confirm', [list])
// emit('confirm', list)
emit('update:visible', false) emit('update:visible', false)
} }
......
...@@ -100,6 +100,7 @@ export default defineComponent({ ...@@ -100,6 +100,7 @@ export default defineComponent({
const confirmModal = () => { const confirmModal = () => {
const list = xTable.value?.getRadioRecord() const list = xTable.value?.getRadioRecord()
console.log(list)
if (list == null) { if (list == null) {
return ElMessage.warning('请选择一条数据!') return ElMessage.warning('请选择一条数据!')
} }
......
...@@ -4,7 +4,11 @@ ...@@ -4,7 +4,11 @@
<template #default> <template #default>
<el-form ref="formRef" :model="form" :rules="rules" label-position="left" label-width="100px"> <el-form ref="formRef" :model="form" :rules="rules" label-position="left" label-width="100px">
<el-form-item label="品牌编码" prop="brandCode"> <el-form-item label="品牌编码" prop="brandCode">
<el-input v-model="form.brandCode" clearable /> <el-input v-model="form.brandCode" disabled>
<template #append>
<el-button :icon="MoreFilled" @click="brandVisible = true" />
</template>
</el-input>
</el-form-item> </el-form-item>
<el-form-item label="客户编码" prop="customerCode"> <el-form-item label="客户编码" prop="customerCode">
...@@ -61,6 +65,8 @@ ...@@ -61,6 +65,8 @@
</vxe-modal> </vxe-modal>
<CustomerModal v-model:visible="customerVisible" @confirm="confirmCustomer" /> <CustomerModal v-model:visible="customerVisible" @confirm="confirmCustomer" />
<BrandModal v-model:visible="brandVisible" @confirm="confirmBrand" />
</template> </template>
<script lang="ts" setup name="UploadInformationInfoDialog"> <script lang="ts" setup name="UploadInformationInfoDialog">
...@@ -70,10 +76,14 @@ import { uploadFile } from '@/api/excel' ...@@ -70,10 +76,14 @@ import { uploadFile } from '@/api/excel'
import { importInformationApi } from '@/api/customer' import { importInformationApi } from '@/api/customer'
import { MoreFilled } from '@element-plus/icons-vue' import { MoreFilled } from '@element-plus/icons-vue'
import CustomerModal from '@/components/CustomerModal/CustomerModal.vue' import CustomerModal from '@/components/CustomerModal/CustomerModal.vue'
import BrandModal from '@/components/BrandModal/BrandModal.vue'
import { ElMessage, genFileId, type FormInstance, type UploadInstance } from 'element-plus' import { ElMessage, genFileId, type FormInstance, type UploadInstance } from 'element-plus'
const route = useRoute() const route = useRoute()
const customerVisible = ref(false) const customerVisible = ref(false)
const brandVisible = ref(false)
const props = defineProps({ const props = defineProps({
visible: { visible: {
...@@ -114,6 +124,14 @@ const confirmCustomer = (list: any) => { ...@@ -114,6 +124,14 @@ const confirmCustomer = (list: any) => {
form.customerCode = item.customerCode form.customerCode = item.customerCode
} }
const confirmBrand = (list: any) => {
const [item] = list
if (!item) return
form.brandCode = item.brandCode
}
const importInformation = async () => { const importInformation = async () => {
const temp = tableData.value.reduce((acc: any, cur: any) => { const temp = tableData.value.reduce((acc: any, cur: any) => {
acc[cur.key] = cur.value || '' acc[cur.key] = cur.value || ''
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<ol class="list-decimal"> <ol class="list-decimal">
<li class="pl-2" v-for="(item, index) in scriptsDesc" :key="index"> <li class="pl-2" v-for="(item, index) in scriptsDesc" :key="index">
<span class="font-bold text-sm">{{ item.scriptName }}</span <span class="font-bold text-sm">{{ item.scriptName }}</span
><span class="text-gray-500">{{ item.scriptDesc }}</span> ><span class="text-gray-500" v-html="item.scriptDesc"></span>
<template v-if="item?.example"> <template v-if="item?.example">
<p class="text-gray-500">示例:</p> <p class="text-gray-500">示例:</p>
<div class="bg-[#1e293b] p-2 text-white rounded expample"> <div class="bg-[#1e293b] p-2 text-white rounded expample">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment