From e00905e53ee5d91d9e488ecf5ece3e25b9889436 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期二, 20 一月 2026 16:14:44 +0800
Subject: [PATCH] 湟水峡 1.采购模块不要项目名称 2.加一个有待回款登记的提示 3.回款登记、付款登记改成和销售订单价格关联,并且可以多个一起回款或付款 4.合同管理不要下载合同了,跟合同相关的字段可以去掉了 5.重构生产模块 6.测试流程并修改bug

---
 src/views/basicData/customerFile/index.vue |  216 ++++++++++++++++++++++++-----------------------------
 1 files changed, 97 insertions(+), 119 deletions(-)

diff --git a/src/views/basicData/customerFile/index.vue b/src/views/basicData/customerFile/index.vue
index c4fa332..6274ace 100644
--- a/src/views/basicData/customerFile/index.vue
+++ b/src/views/basicData/customerFile/index.vue
@@ -34,7 +34,6 @@
         @selection-change="handleSelectionChange"
         :tableLoading="tableLoading"
         @pagination="pagination"
-        :total="total"
       ></PIMTable>
     </div>
     <el-dialog
@@ -61,20 +60,6 @@
             </el-form-item>
           </el-col>
           <el-col :span="12">
-            <el-form-item
-              label="绾崇◣浜鸿瘑鍒彿锛�"
-              prop="taxpayerIdentificationNumber"
-            >
-              <el-input
-                v-model="form.taxpayerIdentificationNumber"
-                placeholder="璇疯緭鍏�"
-                clearable
-              />
-            </el-form-item>
-          </el-col>
-        </el-row>
-        <el-row :gutter="30">
-          <el-col :span="12">
             <el-form-item label="鍏徃鍦板潃锛�" prop="companyAddress">
               <el-input
                 v-model="form.companyAddress"
@@ -83,64 +68,23 @@
               />
             </el-form-item>
           </el-col>
-          <el-col :span="12">
-            <el-form-item label="鍏徃鐢佃瘽锛�" prop="companyPhone">
-              <el-input
-                v-model="form.companyPhone"
-                placeholder="璇疯緭鍏�"
-                clearable
-              />
-            </el-form-item>
-          </el-col>
         </el-row>
         <el-row :gutter="30">
           <el-col :span="12">
-            <el-form-item label="鑱旂郴浜猴細" prop="contactPerson">
-              <el-input
-                v-model="form.contactPerson"
-                placeholder="璇疯緭鍏�"
+            <el-form-item label="瀹㈡埛绫诲瀷锛�" prop="customerType">
+              <el-select
+                v-model="form.customerType"
+                placeholder="璇烽�夋嫨"
                 clearable
-              />
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
-            <el-form-item label="鑱旂郴鐢佃瘽锛�" prop="contactPhone">
-              <el-input
-                v-model="form.contactPhone"
-                placeholder="璇疯緭鍏�"
-                clearable
-              />
-            </el-form-item>
-          </el-col>
-        </el-row>
-        <el-row :gutter="30">
-          <el-col :span="12">
-            <el-form-item label="閾惰鍩烘湰鎴凤細" prop="basicBankAccount">
-              <el-input
-                v-model="form.basicBankAccount"
-                placeholder="璇疯緭鍏�"
-                clearable
-              />
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
-            <el-form-item label="閾惰璐﹀彿锛�" prop="bankAccount">
-              <el-input
-                v-model="form.bankAccount"
-                placeholder="璇疯緭鍏�"
-                clearable
-              />
-            </el-form-item>
-          </el-col>
-        </el-row>
-        <el-row :gutter="30">
-          <el-col :span="12">
-            <el-form-item label="寮�鎴疯鍙凤細" prop="bankCode">
-              <el-input
-                v-model="form.bankCode"
-                placeholder="璇疯緭鍏�"
-                clearable
-              />
+                style="width: 100%"
+              >
+                <el-option
+                  v-for="item in customerTypeOptions"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value"
+                />
+              </el-select>
             </el-form-item>
           </el-col>
         </el-row>
@@ -148,6 +92,7 @@
           <el-col :span="12">
             <el-form-item label="缁存姢浜猴細" prop="maintainer">
               <el-select
+								filterable
                 v-model="form.maintainer"
                 placeholder="璇烽�夋嫨"
                 clearable
@@ -172,7 +117,6 @@
                 type="date"
                 placeholder="璇烽�夋嫨"
                 clearable
-                disabled
               />
             </el-form-item>
           </el-col>
@@ -199,8 +143,11 @@
         :headers="upload.headers"
         :action="upload.url + '?updateSupport=' + upload.updateSupport"
         :disabled="upload.isUploading"
-        :on-progress="handleFileUploadProgress"
-        :on-success="handleFileSuccess"
+        :before-upload="upload.beforeUpload"
+        :on-progress="upload.onProgress"
+        :on-success="upload.onSuccess"
+        :on-error="upload.onError"
+        :on-change="upload.onChange"
         :auto-upload="false"
         drag
       >
@@ -230,7 +177,7 @@
 </template>
 
 <script setup>
-import { ref } from "vue";
+import {onMounted, ref} from "vue";
 import { Search } from "@element-plus/icons-vue";
 import {
   addCustomer,
@@ -250,37 +197,23 @@
   {
     label: "瀹㈡埛鍚嶇О",
     prop: "customerName",
-    width: 220,
   },
   {
-    label: "绾崇◣浜鸿瘑鍒爜",
-    prop: "taxpayerIdentificationNumber",
-    width: 220,
+    label: "瀹㈡埛绫诲瀷",
+    prop: "customerType",
+    dataType: "tag",
+    formatData: (val) => val || "--",
+    formatType: (val) => {
+      const map = {
+				'涓�鎵瑰晢': "primary",
+        '缁堢鍟�': "success",
+      };
+      return map[val] || "info";
+    },
   },
   {
     label: "鍦板潃鍙婅仈绯绘柟寮�",
     prop: "addressPhone",
-    width: 220,
-  },
-  {
-    label: "鑱旂郴浜�",
-    prop: "contactPerson",
-  },
-  {
-    label: "鑱旂郴鐢佃瘽",
-    prop: "contactPhone",
-  },
-  {
-    label: "閾惰鍩烘湰鎴�",
-    prop: "basicBankAccount",
-  },
-  {
-    label: "閾惰璐﹀彿",
-    prop: "bankAccount",
-  },
-  {
-    label: "寮�鎴疯鍙�",
-    prop: "bankCode",
   },
   {
     label: "缁存姢浜�",
@@ -289,18 +222,20 @@
   {
     label: "缁存姢鏃堕棿",
     prop: "maintenanceTime",
+    width: 200,
   },
   {
     dataType: "action",
     label: "鎿嶄綔",
     align: "center",
+		fixed: 'right',
     operation: [
       {
         name: "缂栬緫",
         type: "text",
         clickFun: (row) => {
           openForm("edit", row);
-        },
+        }
       },
     ],
   },
@@ -309,9 +244,15 @@
 const selectedRows = ref([]);
 const userList = ref([]);
 const tableLoading = ref(false);
+// 瀹㈡埛绫诲瀷閫夐」
+const customerTypeOptions = ref([
+  { label: "涓�鎵瑰晢", value: "涓�鎵瑰晢" },
+  { label: "缁堢鍟�", value: "缁堢鍟�" },
+]);
 const page = reactive({
   current: 1,
-  size: 10,
+  size: 100,
+  total: 0,
 });
 const total = ref(0);
 
@@ -324,33 +265,19 @@
   },
   form: {
     customerName: "",
-    taxpayerIdentificationNumber: "",
+		customerType: "",
     companyAddress: "",
-    companyPhone: "",
-    contactPerson: "",
-    contactPhone: "",
     maintainer: "",
     maintenanceTime: "",
-    basicBankAccount: "",
-    bankAccount: "",
-    bankCode: "",
   },
   rules: {
     customerName: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
-    taxpayerIdentificationNumber: [
-      { required: true, message: "璇疯緭鍏�", trigger: "blur" },
-    ],
+		customerType: [{ required: false, message: "璇疯緭鍏�", trigger: "blur" }],
     companyAddress: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
-    companyPhone: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
-    contactPerson: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
-    contactPhone: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
     maintainer: [{ required: false, message: "璇烽�夋嫨", trigger: "change" }],
     maintenanceTime: [
       { required: false, message: "璇烽�夋嫨", trigger: "change" },
     ],
-    basicBankAccount: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
-    bankAccount: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
-    bankCode: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
   },
 });
 const upload = reactive({
@@ -364,9 +291,47 @@
   headers: { Authorization: "Bearer " + getToken() },
   // 涓婁紶鐨勫湴鍧�
   url: import.meta.env.VITE_APP_BASE_API + "/basic/customer/importData",
+  // 鏂囦欢涓婁紶鍓嶇殑鍥炶皟
+  beforeUpload: (file) => {
+    console.log('鏂囦欢鍗冲皢涓婁紶', file);
+    // 鍙互鍦ㄦ澶勫仛鏂囦欢绫诲瀷鎴栧ぇ灏忔牎楠�
+    const isValid = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' || file.name.endsWith('.xlsx') || file.name.endsWith('.xls');
+    if (!isValid) {
+      proxy.$modal.msgError("鍙兘涓婁紶 Excel 鏂囦欢");
+    }
+    return isValid;
+  },
+  // 鏂囦欢鐘舵�佹敼鍙樻椂鐨勫洖璋�
+  onChange: (file, fileList) => {
+    console.log('鏂囦欢鐘舵�佹敼鍙�', file, fileList);
+  },
+  // 鏂囦欢涓婁紶鎴愬姛鏃剁殑鍥炶皟
+  onSuccess: (response, file, fileList) => {
+    console.log('涓婁紶鎴愬姛', response, file, fileList);
+    upload.isUploading = false;
+    if(response.code === 200){
+      proxy.$modal.msgSuccess("鏂囦欢涓婁紶鎴愬姛");
+      upload.open = false;
+      proxy.$refs["uploadRef"].clearFiles();
+      getList();
+    }else if(response.code === 500){
+      proxy.$modal.msgError(response.msg);
+    }else{
+      proxy.$modal.msgWarning(response.msg);
+    }
+  },
+  // 鏂囦欢涓婁紶澶辫触鏃剁殑鍥炶皟
+  onError: (error, file, fileList) => {
+    console.error('涓婁紶澶辫触', error, file, fileList);
+    upload.isUploading = false;
+    proxy.$modal.msgError("鏂囦欢涓婁紶澶辫触");
+  },
+  // 鏂囦欢涓婁紶杩涘害鍥炶皟
+  onProgress: (event, file, fileList) => {
+    console.log('涓婁紶涓�...', event.percent);
+  }
 });
 const { searchForm, form, rules } = toRefs(data);
-
 // 鏌ヨ鍒楄〃
 /** 鎼滅储鎸夐挳鎿嶄綔 */
 const handleQuery = () => {
@@ -383,7 +348,7 @@
   listCustomer({ ...searchForm.value, ...page }).then((res) => {
     tableLoading.value = false;
     tableData.value = res.records;
-    total.value = res.total;
+    page.total = res.total;
   });
 };
 // 琛ㄦ牸閫夋嫨鏁版嵁
@@ -392,12 +357,17 @@
 };
 /** 鎻愪氦涓婁紶鏂囦欢 */
 function submitFileForm() {
+  upload.isUploading = true;
   proxy.$refs["uploadRef"].submit();
 }
 /** 瀵煎叆鎸夐挳鎿嶄綔 */
 function handleImport() {
   upload.title = "瀹㈡埛瀵煎叆";
   upload.open = true;
+}
+/** 涓嬭浇妯℃澘 */
+function importTemplate() {
+  proxy.download("/basic/customer/downloadTemplate", {}, "瀹㈡埛瀵煎叆妯℃澘.xlsx");
 }
 // 鎵撳紑寮规
 const openForm = (type, row) => {
@@ -466,6 +436,12 @@
 const handleDelete = () => {
   let ids = [];
   if (selectedRows.value.length > 0) {
+    // 妫�鏌ユ槸鍚︽湁浠栦汉缁存姢鐨勬暟鎹�
+    const unauthorizedData = selectedRows.value.filter(item => item.maintainer !== userStore.nickName);
+    if (unauthorizedData.length > 0) {
+      proxy.$modal.msgWarning("涓嶅彲鍒犻櫎浠栦汉缁存姢鐨勬暟鎹�");
+      return;
+    }
     ids = selectedRows.value.map((item) => item.id);
   } else {
     proxy.$modal.msgWarning("璇烽�夋嫨鏁版嵁");
@@ -501,7 +477,9 @@
   return `${year}-${month}-${day}`;
 }
 
-getList();
+onMounted(() => {
+	getList();
+});
 </script>
 
 <style scoped lang="scss"></style>

--
Gitblit v1.9.3