Răsfoiți Sursa

设备台账

lipenghui 3 luni în urmă
părinte
comite
b139010246

+ 23 - 14
src/views/pms/device/CustomerList.vue

@@ -8,12 +8,19 @@
       :inline="true"
       label-width="68px"
     >
-      <el-form-item label-width="90px" :label="customerType==='supplier'?'供应商名称':'制造商名称'" prop="name">
+      <el-form-item label-width="90px" label="客商名称" prop="name" >
         <el-input
+          @keyup.enter="handleQuery"
           v-model="queryParams.name"
           placeholder="请输入名称"
-          clearable
+          class="!w-240px"
+        />
+      </el-form-item>
+      <el-form-item label-width="90px" label="客商编号" prop="code" >
+        <el-input
           @keyup.enter="handleQuery"
+          v-model="queryParams.code"
+          placeholder="请输入名称"
           class="!w-240px"
         />
       </el-form-item>
@@ -35,8 +42,9 @@
           />
         </template>
       </el-table-column>
-      <el-table-column :label="customerType==='supplier'?'供应商名称':'制造商名称'" align="center" prop="name" />
-      <el-table-column :label="customerType==='supplier'?'供应商分类':'制造商分类'" align="center" prop="classification" >
+      <el-table-column label="客商名称" align="center" prop="name" />
+      <el-table-column label="客商编号" align="center" prop="code" />
+      <el-table-column label="客商分类" align="center" prop="classification" >
         <template #default="scope">
           <dict-tag :type="DICT_TYPE.SUPPLIER_TYPE" :value="scope.row.classification" />
         </template>
@@ -79,9 +87,9 @@
 
 <script setup lang="ts">
   import {DictDataVO} from "@/api/system/dict/dict.data";
-  import {DICT_TYPE} from "@/utils/dict";
+  import {DICT_TYPE, getIntDictOptions} from "@/utils/dict";
   import {dateFormatter} from "@/utils/formatTime";
-  import { Api } from '@/api/supplier/base'
+  import {Api, SupplierVO} from '@/api/supplier/base'
   import { propTypes } from '@/utils/propTypes'
   const emit = defineEmits(['choose']) // 定义 success 事件,用于操作成功后的回调
   const dialogVisible = ref(false) // 弹窗的是否展示
@@ -89,7 +97,7 @@
   const customerType = ref('') // 弹窗的是否展示
   const loading = ref(true) // 列表的加载中
   const queryFormRef = ref() // 搜索的表单
-  const list = ref<DictDataVO[]>([]) // 列表的数据
+  const list = ref<SupplierVO[]>([]) // 列表的数据
   const total = ref(0) // 列表的总页数
   // const props = defineProps({
   //   type: propTypes.bool.def(), // 是否作为详情组件
@@ -132,15 +140,9 @@
   })
   const open = async (type: string) => {
     dialogVisible.value = true
-    selectedRow.value = null
-    customerType.value = type
-    //queryParams.customerNature = type
-    console.log('----------'+type)
-    await getList()
-    dialogTitle.value = type==='supplier'?'供应商':'制造商';
+
   }
   defineExpose({ open }) // 提供 open 方法,用于打开弹窗
-
   const getList = async () => {
     loading.value = true
     try {
@@ -166,6 +168,13 @@
     queryFormRef.value.resetFields()
     handleQuery()
   }
+  onMounted(async ()=>{
+    selectedRow.value = null
+    // customerType.value = type
+    //
+    // dialogTitle.value = type==='supplier'?'供应商':'制造商';
+    await getList();
+  })
 </script>
 <style scoped lang="scss">
 

+ 4 - 4
src/views/pms/device/IotDeviceForm.vue

@@ -125,7 +125,7 @@
                 v-model="formData.manufacturerId"
                 :model-value="zzLabel"
                 placeholder="请输入制造商"
-                @click="openCustomer('manufacturer')"
+                @click="openCustomer"
               />
             </el-form-item>
           </el-col>
@@ -146,7 +146,7 @@
                 v-model="formData.supplierId"
                 placeholder="请输入供应商"
                 :model-value="supplierLabel"
-                @click="openCustomer('supplier')"
+                @click="openCustomer"
               />
             </el-form-item>
           </el-col>
@@ -454,8 +454,8 @@ const openModelForm = () =>{
   modelFormRef.value.open()
 }
 const customerFormRef = ref()
-const openCustomer = (type) => {
-  customerFormRef.value.open(type)
+const openCustomer = () => {
+  customerFormRef.value.open()
 }
 const allshouqi = () => {
   baseIsExpanded.value = false